{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_widgets %} {% load has_perm_to url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} graphs-root-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Root node') plural=_('{count} Root nodes') empty=verbose_name icon='graph' %} {% endblock %} {% block brick_header_actions %} {% has_perm_to change object as has_perm %} {% brick_header_action id='link' url='graphs__add_roots'|url:object.id label=_('Add some entities') enabled=has_perm %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Entity') status='primary' %} {% brick_table_column title=_('Types of relation') %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endblock %} {% block brick_table_rows %} {% has_perm_to change object as has_perm %}{% url 'graphs__remove_root' as remove_root_url %} {% for rnode in page.object_list %} {# {% widget_entity_hyperlink rnode.entity user %} #} {% widget_entity_hyperlink rnode.real_entity user %} {# {% widget_enumerator rnode.get_relation_types threshold=4 summary=_('{count} types of relationship') empty=_('No type of relationship') %} #} {% widget_enumerator rnode.rtypes_list threshold=4 summary=_('{count} types of relationship') empty=_('No type of relationship') %} {% if rnode.disabled_rtypes_list %}
{% translate 'Disabled types:' %} {% widget_enumerator rnode.disabled_rtypes_list threshold=4 summary=_('{count} types of relationship') %}
{% endif %} {% brick_table_action id='edit' url=rnode.get_edit_absolute_url label=_('Edit this node') enabled=has_perm %} {% brick_table_action id='delete' url=remove_root_url __id=rnode.pk label=_('Remove this node') icon='unlink' enabled=has_perm %} {% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No root node for the moment' %} {% endblock %}