{#
/*
 * Copyright © ProgramCMS. All rights reserved.
 * See COPYING.txt for license details.
 *
 * Developed by Mohamed EL QUCHIRI <elquchiri@gmail.com>
 */
#}
<div data-controller="sidebar" data-action="keydown.esc->sidebar#closeSignClick">
    <div class="sidebar">
        <ul>
            {% for menuItemKey, menuItem in block.getMenu() %}
                <li>
                    <a data-sidebar-target="menuItemLink"
                        data-action="sidebar#menuItemClick"
                        {% if menuItem.htmlClass is defined %}class="{{ menuItem.htmlClass }}"{% endif %}
                        href="{% if menuItem.action is defined %}{{ menuItem.action }}{% endif %}"
                        id="{{ menuItemKey }}">
                        {% if menuItemKey != 'programcms' %}
                            <span>{{ menuItem.label }}</span>
                        {% endif %}
                    </a>
                </li>
            {% endfor %}
        </ul>
    </div>
    {% for menuItemKey, menuItem in block.getMenu() %}
        <div data-sidebar-target="menuItem" class="menu-items" id="{{ menuItemKey }}">
            <div class="menu-item">
                <div class="menu-item-title">{{ menuItem.label }}</div>
                <div class="close-sign" data-sidebar-target="closeSign" data-action="click->sidebar#closeSignClick">&#x2715;</div>
            </div>
            {% if menuItem.groups is defined %}
                {% for group in menuItem.groups %}
                    {% if group.label is defined and group.label is not empty %}
                        <div class="menu-item-group-title">{{ group.label }}</div>
                    {% endif %}
                    <ul>
                        {% for action in group.actions %}
                            <li>
                                <a href="{{ action.action }}">{{ action.label }}</a>
                            </li>
                        {% endfor %}
                    </ul>
                {% endfor %}
            {% endif %}
        </div>
    {% endfor %}
</div>