{% extends 'creme_core/bricks/base/paginated-list.html' %} {% load i18n creme_bricks creme_perms creme_widgets %} {% load url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} creme_config-brickloc-detail-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('Detailed views — {count} Configured type of resource') plural=_('Detailed views — {count} Configured types of resource') icon='config' %} {% endblock %} {% block brick_header_actions %} {% if display_clone_button %} {% brick_header_action id='add' url='creme_config__clone_detailview_bricks'|url label=_('Clone the configuration of a role') enabled=user|has_perm_to_admin:'creme_core' %} {% endif %} {% endblock %} {% block brick_content %} {% with admin_perm=user|has_perm_to_admin:'creme_core' delete_url='creme_config__delete_detailview_bricks'|url %} {% if not page.number or page.number < 2 %}
{% translate 'Default configuration' %} - {% blocktranslate count count=default_count %}{{count}} block{% plural %}{{count}} blocks{% endblocktranslate %}
{% url 'creme_config__edit_detailview_bricks' 0 'default' as edit_def_url %} {% brick_action id='edit' url=edit_def_url label=_('Edit the default configuration') enabled=admin_perm %}
{% endif %} {% for ctw in page.object_list %} {% with ctype=ctw.ctype ctype_default_count=ctw.default_count %}
{% widget_icon ctype=ctype size='brick-list' class='brickloc-config-type-icon' %} {{ctype}}
{% if ctw.locations_info|length < max_conf_count %} {# {% brick_action id='add' url='creme_config__create_detailviews_bricks'|url:ctype.id label=_('Create for a role') enabled=admin_perm display='text' %} #} {% brick_action id='add' url='creme_config__create_detailview_bricks'|url:ctype.id label=_('Create for a role') enabled=admin_perm display='text' %} {% endif %}
{% for role_arg, role_label, role_block_count in ctw.locations_info %} {% endfor %}
{% blocktranslate %}Default configuration for «{{ctype}}»{% endblocktranslate %} {% if ctype_default_count %} {% blocktranslate count count=ctype_default_count %}{{count}} block{% plural %}{{count}} blocks{% endblocktranslate %} {% else %} {% translate '(uses the default blocks configuration)' %} {% endif %} {% url 'creme_config__edit_detailview_bricks' ctype.id 'default' as edit_url %} {% brick_table_action id='edit' url=edit_url enabled=admin_perm %} {% if ctype_default_count %} {% brick_table_action id='delete' url=delete_url __id=ctype.id enabled=admin_perm %} {% endif %}
{{role_label}} {% blocktranslate count count=role_block_count %}{{count}} block{% plural %}{{count}} blocks{% endblocktranslate %} {% url 'creme_config__edit_detailview_bricks' ctype.id role_arg as edit_role_url %} {% brick_table_action id='edit' url=edit_role_url enabled=admin_perm %} {% brick_table_action id='delete' url=delete_url __id=ctype.id __role=role_arg enabled=admin_perm %}
{% endwith %} {% endfor %} {% endwith %} {% endblock %}