{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_perms creme_widgets %} {% load print_field url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} commercial-approaches-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Commercial approach') plural=_('{count} Commercial approaches') empty=verbose_name icon='commercial' %} {% endblock %} {% block brick_header_actions %} {% if object %} {% brick_header_action id='add' url='commercial__create_approach'|url:object.id label=_('New commercial approach') enabled=user|has_perm_to_change:object %} {% endif %} {% endblock %} {% block brick_table_columns %} {% brick_table_column_for_field ctype=objects_ctype field='title' status='primary nowrap' class='approaches-title' %} {% if not object %} {% brick_table_column title=_('Related entity') %} {% endif %} {% trans 'Created on' context 'commercial-approach' as creation_label %} {% brick_table_column_for_field ctype=objects_ctype field='creation_date' status='nowrap' title=creation_label %} {% brick_table_column_for_field ctype=objects_ctype field='description' title=_('Details') class='approaches-details' %} {% brick_table_column title=_('Generate from') status='nowrap' %} {% endblock %} {% block brick_table_rows %} {% for approach in page.object_list %} {% print_field object=approach field='title' %} {% if not object %} {% widget_entity_hyperlink approach.creme_entity user %} {% endif %} {{approach.creation_date|date:'DATE_FORMAT'}} {% print_field object=approach field='description' %} {{approach.related_activity|default:approach.creme_entity|default:_('Nothing')}} {% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No commercial approach for the moment' %} {% endblock %}