{% macro create_album_card(album, view="grid", unlink_parent=none, draggable=false) %} {% set id = "album_card_root" if album == "root" else "album_card_" + album.id %} {% set view = (view if view in ("list", "grid") else "grid") %} {% set viewparam = "?view=list" if view == "list" else "" %}
{% if album == "root" %} {% else %} {% endif %} {% if album.thumbnail_photo %} {% set thumbnail_src = "/thumbnail/" + album.thumbnail_photo.id + ".jpg" %} {% else %} {% set thumbnail_src = "/static/basic_thumbnails/album.png" %} {% endif %}
{% if unlink_parent is not none %} {% endif %}
{% if album == "root" %} Albums {% else %} {{album.display_name}} {% endif %}
{% if album == "root" %} {% else %} {% set child_count = album.sum_children(recurse=False) %} {% set photo_count = album.sum_photos(recurse=False) %} {{child_count}} {{-' | '-}} {{photo_count}} {% endif %}
{% endmacro %}