{% set ariane = getSession('arianeSub') %}
{% if ariane %}
<ul class='nav nav-tabs sous_onglet'>
    {% for property in ariane | filter(property => property is iterable) %}
        {% for item in property | filter(item => item is not empty) %}
            {# TOOD : factorize #}
            {% if ariane.last == item.niveau 
                and ariane.active == item.place
            %}
                <li id="{{ item.idAriane }}" class="active">
                    <a data-toggle="tab" 
                        href="{{ item.href 
                            ? '#' ~ item.href 
                            : 'javascript:void(0)'
                        }}"
                        class="{{ item.badge ? 'white-tooltip' }} {% block class %}{% endblock %}"
                    >
                    {% block label %}
                        {{- item.titre |raw -}}
                        {% if item.activeStatus %}
                            <span class="icopastille text-client1 ml-tiny {{ item.status ? 'primary' : 'muted' }}"></span>
                        {% endif %}
                    {% endblock %}</a>
            {% else %}
                <li id="{{ item.idAriane }}" {{ item.option|raw }} 
                    {% if item.path %}
                    onclick="ariane(
                        {{- item.path | json | e('html_attr') }},
                        {{- item.post | json | e('html_attr') -}}
                    );"
                    {% endif %}
                >
                    <a 
                        {% if item.href %}
                            data-toggle="tab" href="#{{ item.href | e('html_attr') }}"
                        {% endif %}
                        class="{{ item.href ? 'ephemere' }} {{ item.badge ? 'white-tooltip' }} {{ block('class') }}"
                    >
                        {{- block('label') -}}
                        {% if item.badge %}{# TODO : replace 'badge' with twig block inheritance #}
                            <span class="alerte_orange" style="position: absolute; top: -1px; right: -1px"></span>
                            <span class="infos_tooltip top-left">
                                <span class="tooltip-arrow"></span>
                                {{ item.badge }}
                            </span>
                        {% endif %}
                    </a>
                </li>
            {% endif %}
        {% endfor %}
    {% endfor %}
</ul>
{% endif %}