{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_widgets creme_bricks creme_config_tags %} {% load url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} brick-reorderable activities-activity_type-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Sub-type of activity in this type') plural=_('{count} Sub-types of activity in this type') empty=_('Sub-types of activity in this type') %} {% endblock %} {% block brick_header_actions %} {% brick_header_action id='add' url='activities__create_subtype'|url:activity_type.id label=objects_ctype.model_class.creation_label %} {% endblock %} {% block brick_table_columns %} {% brick_table_column title='' class='configmodel-column-order' %} {% brick_table_column_for_field ctype=objects_ctype field='name' status='primary' %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endblock %} {% block brick_table_body %} {% widget_icon name='reorder' size='brick-table-action' class='icon brick-reorderable-handle-icon' as reorder_icon %} {% for sub_type in page.object_list %} {{reorder_icon.render}} {{sub_type.name}} {% config_model_edition_url model_config=model_config instance=sub_type user=user as edit_url %} {% if edit_url %}{% brick_table_action id='edit' url=edit_url %}{% endif %} {% config_model_deletion_url model_config=model_config instance=sub_type user=user as delete_url %}{# TODO: disable if a job exists for this model #} {% if delete_url %}{% brick_table_action id='edit' url=delete_url enabled=sub_type|config_is_custom icon='delete' label=_('Delete') %}{% endif %} {% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No sub-type for the moment' %} {% endblock %}