{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_widgets creme_bricks %} {% load has_perm_to uca_sort url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} creme_config-relation-types-brick{% endblock %} {% block brick_header_title %} {% if custom %} {% brick_header_title title=_('{count} Custom type of relation') plural=_('{count} Custom types of relation') empty=verbose_name icon='relations' %} {% else %} {% brick_header_title title=_('{count} Standard type of relation') plural=_('{count} Standard types of relation') empty=verbose_name icon='relations' %} {% endif %} {% endblock %} {% block brick_header_actions %} {% if custom %} {% has_perm_to admin 'creme_core' as admin_perm %} {% brick_header_action id='add' url='creme_config__create_rtype'|url label=_('New custom type') enabled=admin_perm %} {% endif %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Subject(s)') class='relation-subject' colspan=4 %} {% brick_table_column title=_('Predicate') class='relation-predicate' status='nowrap' %} {% brick_table_column title=_('Object(s)') class='relation-object' colspan=4 %} {% if custom %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endif %} {% endblock %} {% block brick_table_rows %} {% has_perm_to admin 'creme_core' as admin_perm %}{% url 'creme_config__delete_rtype' as delete_url %} {% for relation_type in page.object_list %} {% with sym_type=relation_type.symmetric_type %} {% widget_enumerator relation_type.subject_ctypes.all|uca_sort threshold=5 empty=_('No type') summary=_('{count} types of resource') %} {% widget_enumerator relation_type.subject_properties.all|uca_sort threshold=5 empty=_('No property') summary=_('{count} types of property') %} {% if not relation_type.is_copiable %}{% translate 'No copy' %}{% endif %} {% if relation_type.minimal_display %}{% translate 'Display once' %}{% endif %} {{relation_type.predicate}} — {{sym_type.predicate}} {% widget_enumerator relation_type.object_ctypes.all|uca_sort threshold=5 empty=_('No type') summary=_('{count} types of resource') %} {% widget_enumerator relation_type.object_properties.all|uca_sort threshold=5 empty=_('No property') summary=_('{count} types of property') %} {% if not sym_type.is_copiable %}{% translate 'No copy' %}{% endif %} {% if sym_type.minimal_display %}{% translate 'Display once' %}{% endif %} {% if custom %} {% brick_table_action id='edit' url='creme_config__edit_rtype'|url:relation_type.id label=_('Edit this relation type') enabled=admin_perm %} {% brick_table_action id='delete' url=delete_url __id=relation_type.id label=_('Delete this relation type') enabled=admin_perm %} {% endif %} {% endwith %} {% endfor %} {% endblock %} {% block brick_table_empty %} {% if custom %}{% translate 'No custom type of relation for the moment' %}{% endif %} {% endblock %}