{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_cells creme_widgets creme_bricks creme_ctype %} {% load and_op has_perm_to inner_edition_uri 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 %} {% if relation_type.enabled %} {% 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=relation_type.id __ctype_id=objects_ctype.id __multiple=True %} {% endif %} {% endblock %} {% block brick_before_content %} {% if not relation_type.enabled %}