<!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">
        {% include 'elements/navigation/navigation_sidebar.html.twig' %}
        {% include 'elements/navigation/navigation_topbar.html.twig' %}
        <div 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">
                        <img src="{{ url_for("logo") }}" width="{{ logo.getOptimalWidth() }}" height="{{ logo.getOptimalHeight() }}" alt="{{ preferences.pref_nom }}" class="icon"/>
                        <div class="ui large header">
                            {{ preferences.pref_nom }}
                            <div class="sub header">{% if preferences.pref_slogan %}{{ __(preferences.pref_slogan) }}{% endif %}</div>
                        </div>
                    </div>
                    <h1 class="ui block center aligned header" style="position: relative">
{% else %}
                    <div class="ui horizontal basic segments header">
                        <div class="ui center aligned segment">
                            <h1>
{% endif %}
                                {% block page_title %}{{ page_title }}{% endblock %}
                            </h1>
{% if login.isLogged() %}
                        </div>
                        <div class="ui right aligned compact segment">
                            <div class="ui compact tiny menu">
            {% if cur_route != 'mailing' and existing_mailing == true %}
                                <a
                                    id="recup_mailing"
                                    href="{{ url_for("mailing") }}"
                                    class="ui blue tooltip item"
                                    title="{{ _T("A mailing exists in the current session. Click here if you want to resume or cancel it.") }}"
                                    data-position="bottom right"
                                >
                                    <i class="paper plane outline blue icon"></i>
                                    <span class="displaynone">{{ _T("Existing mailing") }}</span>
                                </a>
            {% endif %}
                                {% include "elements/language.html.twig" with {
                                        ui: "dropdown"
                                } %}
                            </div>
                        </div>
                    </div>
{% endif %}
                    <div class="main-content">
                        {% include "elements/messages_inline.html.twig" %}
                        {% block content %}{{ _T('Page content') }}{% endblock %}
                    </div>
                    {% include "elements/footer.html.twig" %}
                </section>
            </div>
        </div>
        <a href="#" id="back2top" class="circular big ui icon button" title="{{ _T("Back to top") }}">
            <i class="arrow up icon"></i>
        </a>
        {% include "elements/scripts.html.twig" %}
        {% block javascripts %}{% endblock %}
    </body>
</html>
