{#
/**
 * 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/>.
 */
#}
<!DOCTYPE html>

<html lang="{{ galette_lang }}"{% if i18n.isRtl() %} dir="rtl"{% endif %}>
    <head>
        {% include 'elements/header.html.twig' with {
            galette_lang: galette_lang
        } %}
    </head>
    <body id="galette_body" class="pushable dimmable{% if login.isLogged() %} loggedin{% endif %} nojs">
        <a href="#main-content" class="skiptocontent visually-hidden focusable">{{ _T("Skip to content") }}</a>
        {% include 'elements/navigation/navigation_sidebar.html.twig' %}
        {% include 'elements/navigation/navigation_topbar.html.twig' %}
        <main class="pusher">
            <div id="main" class="{% if not login.isLogged() %}container{% else %} full height{% if i18n.isRtl() %} rtl{% endif %}{% endif %}">
{%  if login.isLogged() %}
    {% include 'elements/navigation/navigation_aside.html.twig' %}
{% endif %}
                <section class="content{% if contentcls is defined %} {{ contentcls }}{% endif %}{% if login.getCompactMenu() %} extended{% endif %}">
{% if not login.isLogged() %}
                    <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 large header">
                            {{ preferences.pref_nom }}
                            <div class="sub header">{% if preferences.pref_slogan %}{{ __(preferences.pref_slogan) }}{% endif %}</div>
                        </div>
                    </div>
                    <a id="main-content" tabindex="-1"></a>
                    <h1 class="ui block center aligned header" style="position: relative">
{% else %}
                    <div class="ui horizontal basic segments header">
                        <div class="ui right aligned compact segment">
                            <nav class="ui compact tiny menu" aria-label="{{ _T('Language menu') }}">
                                {% include "elements/language.html.twig" with {
                                        ui: "dropdown"
                                } %}
                            </nav>
                        </div>
                        <a id="main-content" tabindex="-1"></a>
                        <div class="ui center aligned segment">
                            <h1>
{% endif %}
                                {% block page_title %}{{ page_title }}{% endblock %}
                            </h1>
{% if login.isLogged() %}
                        </div>
                    </div>
{% endif %}
                    <div class="main-content">
                        {% include "elements/messages_inline.html.twig" %}
                        {% block content %}{{ _T('Page content') }}{% endblock %}
                    </div>
                </section>
            </div>
        </main>
        {% include "elements/footer.html.twig" %}
        <a href="#" id="back2top" class="circular big ui icon button" title="{{ _T("Back to top") }}">
            <i class="arrow up icon" aria-hidden="true"></i>
        </a>
        {% include "elements/scripts.html.twig" %}
        {% block javascripts %}{% endblock %}
    </body>
</html>
