{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_cells creme_perms creme_widgets %} {% load and_op inner_edition_uri url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} opportunities-managers-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Business manager') plural=_('{count} Business managers') empty=verbose_name icon='contact' %} {% endblock %} {% block brick_header_actions %} {% if relation_type.enabled %} {% brick_header_action id='add-relationships' label=_('Link to a contact') icon='link' enabled=user|has_perm_to_link:object __subject_id=object.id __rtype_id=relation_type.id __ctype_id=objects_ctype.id __multiple=True %} {% endif %} {% endblock %} {% block brick_before_content %} {% if not relation_type.enabled %}
{% blocktranslate with predicate=relation_type.predicate %}Beware: the relationship type «{{predicate}}» is disabled. You should re-enable it if it's still useful, or remove this block{% endblocktranslate %}
{% endif %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Name') status='primary nowrap' %} {% for cell in cells %} {% brick_table_column_for_cell cell=cell %} {% endfor %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endblock %} {% block brick_table_rows %} {% with unlink_perm=user|has_perm_to_unlink:object delete_relation_url='creme_core__delete_similar_relations'|url %} {% for manager in page.object_list %} {% widget_entity_hyperlink manager user %} {% if user|has_perm_to_view:manager %} {% for cell in cells %} {% cell_render cell=cell instance=manager user=user as cell_content %} {% if cell_content %}{{cell_content}}{% else %}{% endif %} {% endfor %} {% else %} {% for cell in cells %}{{HIDDEN_VALUE}}{% endfor %} {% endif %} {% comment %} {% if cells %}{% inner_edition_uri instance=manager cells=cells callback_url=object.get_absolute_url as edition_uri %} {% brick_table_action id='edit' url=edition_uri label=_('Edit this contact') enabled=user|has_perm_to_change:manager %} {% endcomment %} {% if cells %}{% inner_edition_uri instance=manager cells=cells as edition_uri %} {% brick_table_action id='edit' url=edition_uri comeback=True label=_('Edit this contact') enabled=user|has_perm_to_change:manager %} {% else %} {% brick_table_action id='redirect' url=manager.get_edit_absolute_url label=_('Edit this contact') icon='edit' enabled=user|has_perm_to_change:manager comeback=True %} {% endif %} {% with mngr_unlink_perm=user|has_perm_to_unlink:manager %} {% brick_table_action id='delete' url=delete_relation_url __subject_id=object.id __type=relation_type.id __object_id=manager.id label=_('Unlink this contact') icon='unlink' enabled=unlink_perm|and_op:mngr_unlink_perm %} {% endwith %} {% endfor %} {% endwith %} {% endblock %} {% block brick_table_empty %} {% translate 'No business manager for the moment' %} {% endblock %}