{% extends 'creme_core/bricks/base/paginated-list.html' %} {% load i18n creme_bricks creme_cells creme_ctype creme_perms creme_widgets %} {% load and_op inner_edition_uri is_plural templatize url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} creme_core-specific-relations-brick{% endblock %} {% block brick_menu_actions %} {{block.super}} {% if relation_type.enabled %} {% with config_perm=user|has_perm_to_admin:'creme_core' %}
{% cell_render cell=cell instance=entity_obj user=user as cell_content %} {% if cell_content %}{{cell_content}}{% else %}{% translate '(empty)' %}{% endif %} {% else %} | {% cell_render cell=cell instance=entity_obj user=user as cell_content %} {% if cell_content %}{{cell_content}}{% else %}—{% endif %} {% endif %} | {% endfor %} {% else %} {% for cell in cells %}{{HIDDEN_VALUE}} | {% endfor %} {% endif %} {#{% inner_edition_uri instance=entity_obj cells=cells callback_url=request.get_full_path as edition_uri %} #} | {% inner_edition_uri instance=entity_obj cells=cells as edition_uri %} {% blocktranslate with object=entity_obj asvar edition_label %}Edit «{{object}}»{% endblocktranslate %} {% brick_table_action id='edit' url=edition_uri label=edition_label enabled=user|has_perm_to_change:entity_obj comeback=True %} | {% if not relation_type.is_internal %}{% with object_unlink_perm=user|has_perm_to_unlink:entity_obj %} {% brick_table_action id='delete' url=delete_url __id=entity_obj.srb_relation_cache.id label=_('Delete this relationship') icon='unlink' enabled=subject_unlink_perm|and_op:object_unlink_perm %} {% endwith %} | {% endif %}
{% widget_entity_hyperlink entity_obj user %} | {% if not relation_type.is_internal %} {% with object_unlink_perm=user|has_perm_to_unlink:entity_obj %} {% brick_table_action id='delete' url=delete_url __id=entity_obj.srb_relation_cache.id label=_('Delete this relationship') icon='unlink' enabled=subject_unlink_perm|and_op:object_unlink_perm %} {% endwith %} {% endif %} |