{% extends 'knp_menu.html.twig' %}

{% block root %}
    {% if isFrontOffice is defined and isFrontOffice == true %}
        <div class="ui fluid vertical menu list-group" role="listitem">
            <div class="header item list-group-item disabled" aria-disabled="true">{{ item.label|trans }}</div>
            {{ block('list') }}
        </div>
    {% else %}
        <div class="ui fluid vertical menu">
            <div class="header item">{{ item.label|trans }}</div>
            {{ block('list') }}
        </div>
    {% endif %}
{% endblock %}

{% block list %}
    {% for item in item.children %}
        {{ block('item') }}
    {% endfor %}
{% endblock %}

{% block item %}
    {% if isFrontOffice is defined and isFrontOffice == true %}
        <a class="item list-group-item list-group-item-action" href="{{ item.uri }}">
            {{ block('icon') }}
            {{ item.label|trans }}
        </a>
    {% else %}
        <a class="item" href="{{ item.uri }}">
            {{ block('icon') }}
            {{ item.label|trans }}
        </a
    {% endif %}
{% endblock %}

{% block icon %}
    {% set icon = item.labelAttribute('icon') %}
    {% if icon %}<i class="icon {{ icon }}"></i>&nbsp;{% endif %}
{% endblock %}
