{# vim: set ts=2 et sts=2 sw=2: #} {% macro attachment(image, user=None, has_form=True) -%}
{% if user and (user == image.creator or user.has_perm('upload.delete_attachment')) %} {% if has_form %}
{{ csrf() }}
{% else %} {% endif %} {% endif %}
{%- endmacro %} {% macro attachments_form(model_name, object_id, images, settings, user=None) -%}
{{ _('Uploaded images:') }}
{% for image in images %} {{ attachment(image, user, False) }} {% endfor %}
{%- endmacro %}