{% block list_scopes %}
    {{ echo_block("list_scopes") }}
    {% if scopes|default is not empty %}
        <div class="row">
            <div class="list-scopes" role="scopes">
                {% for groupName, group in scopes %}
                    {{ echo_block("list_scopes_"~(groupName|lower)) }}
                    <div class="list-scopes-group list-scopes-{{ groupName|lower }} btn-group">
                        {% for scopeName, params in group %}
                        <a class="{{ 'btn btn-sm ' ~ params.class|default('btn-default') }} {{ echo_twig("scopes['" ~ groupName ~ "'] == '" ~ scopeName ~ "' ? 'active': 'inactive'") }}"
                           href="{{ echo_path(
                               builder.routePrefixWithSubfolder ~ '_' ~ bundle_name ~ ( builder.BaseGeneratorName ? "_" ~ builder.BaseGeneratorName : "" ) ~ '_scopes',
                               "{ 'group': '" ~  groupName ~ "', 'scope': '" ~ scopeName ~ "' }") }}
                           ">
                            {%- if params.icon is defined %}<i class="fa {{ params.icon }}"></i> {% endif -%}
                            {{- echo_trans(scopeName, {}, i18n_catalog|default("Admin")) -}}
                        </a>
                        {% endfor %}
                    </div>
                    {{ echo_endblock() }}
                {% endfor %}
            </div>
        </div>
    {% endif %}
    {{ echo_endblock() }}
{% endblock %}

{% block list_scopes %}
    {{ echo_block("list_scopes") }}
    {% if scopes|default is not empty %}
        <div class="row">
            <div class="list-scopes" role="scopes">
                {% for groupName, group in scopes %}
                    {{ echo_block("list_scopes_"~(groupName|classify|replace({'.': '_'})|lower)) }}
                    <div class="list-scopes-group list-scopes-{{ groupName|classify|replace({'.': '-'})|lower }} btn-group">
                        {% for scopeName, params in group %}
                        <a class="{{ 'btn btn-sm ' ~ params.class|default('btn-default') }} {{ echo_twig("scopes['" ~ groupName ~ "'] == '" ~ scopeName ~ "' ? 'active': 'inactive'") }}"
                           href="{{ echo_path(
                               builder.routePrefixWithSubfolder ~ '_' ~ bundle_name ~ ( builder.BaseGeneratorName ? "_" ~ builder.BaseGeneratorName : "" ) ~ '_scopes',
                               "{ 'group': '" ~  groupName ~ "', 'scope': '" ~ scopeName ~ "' }") }}
                           ">
                            {%- if params.icon is defined %}<i class="fa {{ params.icon }}"></i> {% endif -%}
                            {{- echo_trans(scopeName, {}, i18n_catalog|default("Admin")) -}}
                        </a>
                        {% endfor %}
                    </div>
                    {{ echo_endblock() }}
                {% endfor %}
            </div>
        </div>
    {% endif %}
    {{ echo_endblock() }}
{% endblock %}

FIX Scopes templates: sanitize scope groupName. TODO: design scopes
FIX Scopes templates: sanitize scope groupName.
TODO: design scopes
