{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_widgets creme_bricks creme_ctype %} {% load and_op has_perm_to url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} opportunities-contacts-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Contact linked to this opportunity') plural=_('{count} Contacts linked to this opportunity') empty=_('Contacts linked to this opportunity') icon='contact' %} {% endblock %} {% block brick_header_actions %} {% has_perm_to link object as link_perm %} {% ctype_for_swappable 'PERSONS_CONTACT_MODEL' as ct_contact %} {% has_perm_to create ct_contact as creation_perm %} {% brick_header_action id='add' url='opportunities__create_related_contact'|url:object.id label=_('Create a contact') enabled=creation_perm|and_op:link_perm %} {% brick_header_action id='add-relationships' label=_('Link to contacts') icon='link' enabled=link_perm __subject_id=object.id __rtype_id=predicate_id __ctype_id=objects_ctype.id __multiple=True %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Name') status='primary nowrap' %} {% brick_table_column title=_('Unlink') status='action' %} {% endblock %} {% block brick_table_rows %} {% has_perm_to unlink object as unlink_perm %}{% url 'creme_core__delete_similar_relations' as delete_relation_url %} {% for contact in page.object_list %} {% has_perm_to unlink contact as contact_unlink_perm %}