{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_perms creme_widgets sms_tags %} {% load url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} sms-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 %} {% with edit_perm=user|has_perm_to_change:object %} {% brick_header_action id='link' url='sms__add_contacts_to_mlist_from_filter'|url:object.id label=_('Add from a filter') enabled=edit_perm %} {% brick_header_action id='link' url='sms__add_contacts_to_mlist'|url:object.id label=_('Add contacts') enabled=edit_perm %} {% endwith %} {% endblock %} {% block brick_table_columns %} {% if not field_hidden %} {% brick_table_column title=_('Number') status='primary' %} {% brick_table_column title=_('Action') status='action' %} {% endif %} {% endblock %} {% block brick_table_rows %} {% if field_hidden %} {% translate "The field «Mobile» of Contact is hidden; in order to use this block, you have to reactivate it (so please contact your administrator)." %} {% else %} {% with edit_perm=user|has_perm_to_change:object rm_contact_url='sms__remove_contact_from_mlist'|url:object.id %} {% for contact in page.object_list %} {% widget_entity_hyperlink contact user %} {% if user|has_perm_to_view:contact %}  : {% if contact.mobile %}{{contact.mobile|sms_phonenumber|sms_formatphone}}{% else %}{% translate 'no number' %}{% endif %} {% endif %} {% brick_table_action id='delete' url=rm_contact_url __id=contact.id label=_('Remove this contact') icon='unlink' enabled=edit_perm %} {% endfor %} {% endwith %} {% endif %} {% endblock %} {% block brick_table_empty %} {% translate 'No contact recipient for the moment' %} {% endblock %}