{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks %} {% load url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} commercial-segments-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Market segment') plural=_('{count} Market segments') empty=verbose_name %} {% endblock %} {% block brick_header_actions %} {% brick_header_action id='add' url='commercial__create_segment'|url label=_('New segment') %} {% endblock %} {% block brick_table_columns %} {% brick_table_column_for_field ctype=objects_ctype field='name' status='primary nowrap' %} {% if page.paginator.count > 1 %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% else %} {% brick_table_column title=_('Action') status='action' %} {% endif %} {% endblock %} {% block brick_table_rows %} {% for segment in page.object_list %} {{segment.name}} {% brick_table_action id='edit' url=segment.get_edit_absolute_url label=_('Edit this segment') %} {% if page.paginator.count > 1 %} {% if segment.property_type_id %} {% brick_table_action id='edit' url='commercial__delete_segment'|url:segment.id label=_('Delete this segment') icon='delete' %} {% endif %} {% endif %} {% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No market segment for the moment' %} {% endblock %}