{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_widgets %}{% load and_op has_perm_to url url_join from creme_core_tags %} {% block brick_extra_class %}{{block.super}} creme_core-relations-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Relationship') plural=_('{count} Relationships') empty=verbose_name icon='relations' %} {% endblock %} {% block brick_header_actions %} {% has_perm_to link object as subject_link_perm %} {% url_join 'creme_core__create_relations'|url:object.id exclude=excluded_rtype_ids as create_uri %} {% brick_header_action id='link' url=create_uri label=_('New relationships') enabled=subject_link_perm %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Name') status='primary' colspan=2 %} {# {% brick_table_column_for_field ... field='type' .. %} #} {% brick_table_column title=_('Action') status='action' %} {% endblock %} {% block brick_table_rows %} {% has_perm_to unlink object as subject_unlink_perm %}{% url 'creme_core__delete_relation' as delete_url %} {% regroup page.object_list by type as relations_by_rtype %} {% for rtype, relations in relations_by_rtype %} {% for relation in relations %}{% with entity_obj=relation.real_object %}