{% set displayNav = true %}
{% set groups = configuration|blockTypesActionsGroups %}
{% set modalTitle = 'Ajouter un bloc'|trans %}
{% if groups|length == 1 and groups['block'] is defined and groups['block']|length == 1 and groups['block']['form'] is defined %}
{% set displayNav = false %}
{% set modalTitle = 'Ajouter un champs'|trans %}
{% elseif groups|length == 1 and groups['block'] is defined and groups['block']|length == 1 and groups['block']['layout'] is defined %}
{% set displayNav = false %}
{% endif %}
{{ modalTitle }}
{% set titles = {
"block-layout": "Blocs de mise en page"|trans,
"block-form": "Champs de formulaire"|trans,
"block-main": "Blocs les plus utilisés"|trans,
"block-secondary": "Autres blocs"|trans,
"module-main": "Modules les plus utilisés"|trans,
"module-secondary": "Autres modules"|trans
} %}
{% if displayNav %}
{% for type, group in groups %}
{% set isActive = loop.first %}
{% for category, blocksActions in group %}
{% set isActive = isActive and loop.first %}
{% for type, group in groups %}
{% set isActive = loop.first %}
{% for category, blocksActions in group %}
{% set smBlocks = blocksActions|length > 9 %}
{% set xsBlocks = blocksActions|length > 12 %}
{% set isActive = isActive and loop.first %}
{% for blockAction in blocksActions %}
{% set path = "#" %}
{% set title = "?" %}
{% if type == 'block' %}
{% set title = blockAction.slug|trans([], 'entity_blocktype') %}
{% set title = title != blockAction.slug ? title : blockAction.adminName %}
{% set path = path('admin_block_add', {'website': websiteId(), 'interfaceName': interface.name, 'interfaceEntity': entity.id, 'col': col.id, 'blockType': blockAction.id}) %}
{% elseif type == 'module' and blockTypeAction %}
{% set title = blockAction.slug|trans([], 'entity_action') %}
{% set title = title != blockAction.slug ? title : blockAction.adminName %}
{% set path = path('admin_block_add', {'website': websiteId(), 'interfaceName': interface.name, 'interfaceEntity': entity.id, 'col': col.id, 'blockType': blockTypeAction.id, 'action': blockAction.id}) %}
{% endif %}