{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_perms creme_widgets %} {% load url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} creme_config-semifixed-rtypes-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Semi-fixed type of relationship') plural=_('{count} Semi-fixed types of relationship') empty=verbose_name icon='relations' %} {% endblock %} {% block brick_header_actions %} {% brick_header_action id='add' url='creme_config__create_semifixed_rtype'|url label=_('New semi-fixed type') enabled=user|has_perm_to_admin:'creme_core' %} {% endblock %} {% block brick_before_content %}
{% translate 'If you often manually create Relationships with the same type and object entity, semi-fixed types create a shortcut' %}
{% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Predicate') status='nowrap' %} {% brick_table_column title=_('Object') %} {% brick_table_column title=_('Type of relationship') %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endblock %} {% block brick_table_rows %} {% with admin_perm=user|has_perm_to_admin:'creme_core' delete_url='creme_config__delete_semifixed_rtype'|url %} {% for sf_rtype in page.object_list %} {% with rtype=sf_rtype.relation_type %} {{sf_rtype.predicate}} {% widget_entity_hyperlink sf_rtype.real_object user %} {{rtype}} {% if rtype.enabled %} {% brick_table_action id='edit' url='creme_config__edit_semifixed_rtype'|url:sf_rtype.id label=_('Edit this type') enabled=admin_perm %} {% else %} {% brick_table_action id='edit' label=_('Edit this type') help_text=_('You cannot edit because the relationship type is disabled') enabled=False %} {% endif %} {% brick_table_action id='delete' url=delete_url __id=sf_rtype.id label=_('Delete this type') enabled=admin_perm %} {% endwith %} {% endfor %} {% endwith %} {% endblock %} {% block brick_table_empty %} {% translate 'No semi-fixed type of relationship for the moment' %} {% endblock %}