{% 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}} commercial-opportunities-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Related opportunity') plural=_('{count} Related opportunities') empty=_('Opportunities') icon='opportunity' %} {% endblock %} {% block brick_header_actions %} {% ctype_for_swappable 'OPPORTUNITIES_OPPORTUNITY_MODEL' as opp_ct %} {% has_perm_to link object as link_perm %}{% has_perm_to create opp_ct as opp_creation_perm %}{% has_perm_to link opp_ct.model_class as opp_link_perm %} {% brick_header_action id='add' url='commercial__create_opportunity'|url:object.id label=_('Create a linked opportunity') enabled=link_perm|and_op:opp_creation_perm|and_op:opp_link_perm %} {% brick_header_action id='add-relationships' label=_('Link to an existing opportunity') icon='link' enabled=link_perm __subject_id=object.id __rtype_id=predicate_id __ctype_id=opp_ct.id __multiple=True %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title=_('Name') status='primary nowrap' %} {% brick_table_column title=_('Sales phase') %} {% brick_table_column title=_('Estimated sales') data_type='money' %} {% brick_table_column title=_('Made sales') data_type='money' %} {% brick_table_column title=_('Unlink') status='action' %} {% endblock %} {% block brick_table_rows %} {% has_perm_to link object as link_perm %}{% has_perm_to unlink object as unlink_perm %} {% url 'creme_core__delete_similar_relations' as del_rel_url %} {% for opp in page.object_list %}{% has_perm_to view opp as opp_view_perm %}{% has_perm_to unlink opp as opp_unlink_perm %}