{#
/**
 * Copyright © 2003-2024 The Galette Team
 *
 * This file is part of Galette (https://galette.eu).
 *
 * Galette is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Galette is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
 */
#}
<aside id="sidemenu" class="ui computer toc{% if login.getCompactMenu() %} compact_menu{% endif %}">
    {% include "elements/logged_user.html.twig" with {
            ui: "menu"
    } %}

{% if not login.getCompactMenu() %}
    <div class="ui basic center aligned fitted segment">
    {% if preferences.pref_website is not empty %}
        <a href="{{ preferences.pref_website }}" target="_blank">
            <img src="{{ url_for('logo') }}" width="{{ logo.getOptimalWidth() }}" height="{{ logo.getOptimalHeight() }}" alt="{{ preferences.pref_nom }}" class="icon" title="{{ _T("Open '%s' in a new window")|replace({"%s": preferences.pref_website}) }}"/>
        </a>
    {% else %}
        <img src="{{ url_for('logo') }}" width="{{ logo.getOptimalWidth() }}" height="{{ logo.getOptimalHeight() }}" alt="{{ preferences.pref_nom }}" class="icon"/>
    {% endif %}
        <div class="ui block huge brand header">
            {{ preferences.pref_nom }}
            {% if preferences.pref_slogan %}<div class="sub tiny header">{{ __(preferences.pref_slogan) }}</div>{% endif %}
        </div>
    </div>
{% endif %}

    <nav class="ui vertical{% if not login.getCompactMenu() %} accordion compact{% else %} tiny icon{% endif %} fluid menu" aria-label="{{ _T('Main menu') }}">
        {% set mode = login.getCompactMenu() ? "compact" : "default" %}
        {% include "elements/navigation/navigation_items.html.twig" with {
                mode: mode
        } %}
    </nav>

    <div class="ui basic fitted segment">
        <div class="ui toggle mini checkbox">
            <input type="checkbox" name="compactmenu" id="compactmenu" class="hidden"{% if login.getCompactMenu() %} checked="checked"{% endif %}>
            <label for="compactmenu"{% if login.getCompactMenu() %} class="tooltip" data-html="{{ _T("Compact menu") }}"{% endif %}>
                {% if not login.getCompactMenu() %}{{ _T("Compact menu") }}{% endif %}
            </label>
        </div>
    </div>
</aside>
