{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_widgets %} {% load has_perm_to url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} emails-contacts-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Contact-recipient') plural=_('{count} Contact-recipients') empty=verbose_name icon='contact' %} {% endblock %} {% block brick_header_actions %} {% has_perm_to change object as has_perm %} {% brick_header_action id='link' url='emails__add_contacts_to_mlist_from_filter'|url:object.id label=_('Add from a filter') enabled=has_perm %} {% brick_header_action id='link' url='emails__add_contacts_to_mlist'|url:object.id label=_('Add contacts') enabled=has_perm %} {% endblock %} {% block brick_table_columns %} {% if not field_hidden %} {% brick_table_column title=_('Address') status='primary' %} {% brick_table_column title=_('Action') status='action' %} {% endif %} {% endblock %} {% block brick_table_rows %} {% if field_hidden %} {% translate "The field «Email address» of Contact is hidden ; in order to use this block, you have to reactivate it (so please contact your administrator)." %} {% else %}{% has_perm_to change object as edit_perm %}{% url 'emails__remove_contact_from_mlist' object.id as rm_contact_url %} {% for contact in page.object_list %} {% has_perm_to view contact as contact_perm %} {% widget_entity_hyperlink contact user %} {% if contact_perm %} : {{contact.email|default:_('no email address')}}{% endif %} {% brick_table_action id='delete' url=rm_contact_url __id=contact.id label=_('Remove this contact') icon='unlink' enabled=edit_perm %} {% endfor %} {% endif %} {% endblock %} {% block brick_table_empty %} {% translate 'No contact recipient for the moment' %} {% endblock %}