{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_perms creme_widgets %} {% load and_op format_amount url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} opportunities-opportunities-brick{% endblock %} {% block brick_header_title %} {% if is_organisation %} {% brick_header_title title=_('{count} Opportunity which targets the organisation') plural=_('{count} Opportunities which target the organisation') empty=_('Opportunities') icon='opportunity' %} {% elif is_contact %} {% brick_header_title title=_('{count} Opportunity which targets the contact') plural=_('{count} Opportunities which target the contact') empty=_('Opportunities') icon='opportunity' %} {% else %} {% brick_header_title title=_('{count} Opportunity which targets the entity') plural=_('{count} Opportunities which target the entity') empty=_('Opportunities') icon='opportunity' %} {% endif %} {% endblock %} {% block brick_header_actions %} {% with link_perm=user|has_perm_to_link:object creation_perm=user|has_perm_to_create:objects_ctype %} {% brick_header_action id='add' url='opportunities__create_related_opportunity_popup'|url:object.id label=_('Create an opportunity') enabled=creation_perm|and_op:link_perm %} {% endwith %} {% endblock %} {% block brick_table_columns %} {% brick_table_column_for_field ctype=objects_ctype field='name' title=_('Name') status='primary' %} {% brick_table_column title=_('Sales phase') %} {% if 'estimated_sales' not in hidden_fields %} {% brick_table_column_for_field ctype=objects_ctype field='estimated_sales' data_type='money' %} {% endif %} {% if 'made_sales' not in hidden_fields %} {% brick_table_column_for_field ctype=objects_ctype field='made_sales' data_type='money' %} {% endif %} {% brick_table_column title=_('Action') status='action' %} {% endblock %} {% block brick_table_rows %} {% with unlink_perm=user|has_perm_to_unlink:object delete_multi_url='creme_core__delete_entities'|url %} {% for opportunity in page.object_list %}