{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_perms creme_widgets %} {% load url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} emails-attachments-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Attachment') plural=_('{count} Attachments') empty=verbose_name icon='document' %} {% endblock %} {% block brick_header_actions %} {% brick_header_action id='link' url='emails__add_attachments_to_template'|url:object.id label=_('Add documents') enabled=user|has_perm_to_change:object %} {% endblock %} {% block brick_table_columns %} {% brick_table_column_for_field ctype=objects_ctype field='title' status='primary' %} {% brick_table_column title=_('Action') status='action' %} {% endblock %} {% block brick_table_rows %} {% with edit_perm=user|has_perm_to_change:object rm_attachment_url='emails__remove_attachment_from_template'|url:object.id %} {% for attachment in page.object_list %} {% widget_entity_hyperlink attachment user %} {% brick_table_action id='delete' url=rm_attachment_url __id=attachment.id label=_('Remove this attachment') icon='unlink' enabled=edit_perm %} {% endfor %} {% endwith %} {% endblock %} {% block brick_table_empty %} {% translate 'No attachment for the moment' %} {% endblock %}