{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_widgets creme_bricks %} {% load and_op has_perm_to print_field url_join from creme_core_tags %} {% block brick_header_actions %} {% has_perm_to link object as obj_link_perm %}{% has_perm_to link objects_ctype.model_class as contact_link_perm %}{% has_perm_to create objects_ctype as creation_perm %} {% url 'persons__create_related_contact' object.id rtype_id as people_creation_url %} {% url_join people_creation_url callback_url=object.get_absolute_url as creation_uri %} {% brick_header_action id='add-relationships' label=_('Link to contacts') icon='link' enabled=obj_link_perm|and_op:contact_link_perm __subject_id=object.id __rtype_id=rtype_id __ctype_id=objects_ctype.id __multiple=True %} {% brick_header_action id='redirect' url=creation_uri type='add' label=add_title enabled=creation_perm %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Name') status='primary nowrap' %}{# {% brick_table_column_for_field ctype=objects_ctype field='headerfilter_search... #} {% if 'phone' not in hidden_fields %} {% brick_table_column_for_field ctype=objects_ctype field='phone' title=_('Phone') %} {% endif %} {% if 'mobile' not in hidden_fields %} {% brick_table_column_for_field ctype=objects_ctype field='mobile' %} {% endif %} {% if 'email' not in hidden_fields %} {% brick_table_column_for_field ctype=objects_ctype field='email' %} {% endif %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endblock %} {% block brick_table_rows %} {% url 'creme_core__delete_similar_relations' as del_rel_url %} {% for people in page.object_list %} {% has_perm_to view people as people_view_perm %} {% widget_entity_hyperlink people user %} {% if 'phone' not in hidden_fields %} {% if people_view_perm %}{% print_field object=people field='phone' %}{% else %}{{HIDDEN_VALUE}}{% endif %} {% endif %} {% if 'mobile' not in hidden_fields %} {% if people_view_perm %}{% print_field object=people field='mobile' %}{% else %}{{HIDDEN_VALUE}}{% endif %} {% endif %} {% if 'email' not in hidden_fields %} {% if people_view_perm %}{% print_field object=people field='email' %}{% else %}{{HIDDEN_VALUE}}{% endif %} {% endif %} {% has_perm_to change people as people_edit_perm %} {% brick_table_action id='redirect' url=people.get_edit_absolute_url|add:'?callback_url=${location}' label=_('Edit this contact') icon='edit' enabled=people_edit_perm %} {% has_perm_to unlink people as people_unlink_perm %} {% brick_table_action id='delete' url=del_rel_url __subject_id=object.id __type=rtype_id __object_id=people.pk label=_('Unlink this contact') icon='unlink' enabled=people_unlink_perm %} {% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No related contact for the moment' %} {% endblock %}