{% macro display_album(a, edit_mode) %} {% if a.file %} {% set img = a.get_download_url() %} {% set src = a.name %} {% elif a.children.filter(is_folder=False, is_moderated=True).exists() %} {% set picture = a.children.filter(is_folder=False).first().as_picture %} {% set img = picture.get_download_thumb_url() %} {% set src = picture.name %} {% else %} {% set img = static('core/img/sas.jpg') %} {% set src = "sas.jpg" %} {% endif %}
{{ src }} {% if not a.is_moderated %}
 
{% trans %}To be moderated{% endtrans %}
{% else %}
{{ a.name }}
{% endif %}
{% if edit_mode %} {% endif %}
{% endmacro %} {% macro print_path(file) %} {% if file and file.parent %} {{ print_path(file.parent) }} {{ file.get_display_name() }} / {% endif %} {% endmacro %} {# Helper macro to create a download button for a record of albums with alpine This needs to be used inside an alpine environment. Downloaded pictures will be `pictures` from the parent data store. Note: This requires importing `bundled/sas/pictures-download-index.ts` Parameters: name (str): name displayed on the button #} {% macro download_button(name) %}
{% endmacro %}