{% extends "pretixpresale/base.html" %}
{% load i18n %}
{% load static %}
{% load thumb %}
{% load eventurl %}
{% load safelink %}
{% block thetitle %}
    {% block title %}{% endblock %}{% if url_name != "organizer.index" %} :: {% endif %}{{ organizer.name }}
{% endblock %}
{% block custom_header %}
    {% if organizer.settings.meta_noindex %}
        <meta name="robots" content="noindex, nofollow">
    {% endif %}
    <meta property="og:type" content="website" />
    {{ block.super }}
{% endblock %}
{% block above %}
    {% if organizer.settings.locales|length > 1 or request.organizer.settings.customer_accounts %}
        {% if organizer.settings.theme_color_background|upper != "#FFFFFF" or organizer.settings.organizer_logo_image_large %}
            <div class="container page-header-links">
                <div class="pull-right header-part flip">
                    {% if organizer.settings.locales|length > 1 %}
                        <nav class="locales" aria-label="{% trans "select language" %}">
                            {% for l in languages %}
                                <a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}%3F{{ request.META.QUERY_STRING|urlencode }}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow"
                                    lang="{{ l.code }}" hreflang="{{ l.code }}"
                                    aria-label="{% language l.code %}{% blocktrans trimmed with language=l.name_local %}
                                        Website in {{ language }}
                                    {% endblocktrans %}{% endlanguage %}">{{ l.name_local }}</a>
                            {% endfor %}
                        </nav>
                    {% endif %}
                    {% include "pretixpresale/fragment_login_status.html" %}
                </div>
            </div>
        {% endif %}
    {% endif %}
{% endblock %}
{% block page %}
    <div class="page-header{% if organizer_logo %} pager-header-with-logo{% endif %}{% if organizer_logo and organizer.settings.organizer_logo_image_large %} logo-large{% endif %}">
        <div class="{% if not organizer_logo or not organizer.settings.organizer_logo_image_large %}pull-left flip{% endif %}">
            {% if organizer_logo and organizer.settings.organizer_logo_image_large %}
                <a href="{% eventurl organizer "presale:organizer.index" %}" title="{{ organizer.name }}">
                    <img src="{{ organizer_logo|thumb:'1170x5000' }}" alt="{{ organizer.name }}"
                         class="organizer-logo" />
                </a>
            {% elif organizer_logo %}
                <a href="{% eventurl organizer "presale:organizer.index" %}" title="{{ organizer.name }}">
                    <img src="{{ organizer_logo|thumb:'5000x120' }}" alt="{{ organizer.name }}"
                            class="organizer-logo" />
                </a>
            {% else %}
                <h1><a href="{% eventurl organizer "presale:organizer.index" %}">{{ organizer.name }}</a></h1>
            {% endif %}
        </div>
        {% if organizer.settings.locales|length > 1 or request.organizer.settings.customer_accounts %}
            {% if organizer.settings.theme_color_background|upper == "#FFFFFF" and not organizer.settings.organizer_logo_image_large %}
                <div class="{% if not organizer_logo or not organizer.settings.organizer_logo_image_large %}pull-right flip{% endif %} loginbox">
                    {% if organizer.settings.locales|length > 1 %}
                        <nav class="locales" aria-label="{% trans "select language" %}">
                            {% for l in languages %}
                                <a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}%3F{{ request.META.QUERY_STRING|urlencode }}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow"
                                    lang="{{ l.code }}" hreflang="{{ l.code }}"
                                    aria-label="{% language l.code %}{% blocktrans trimmed with language=l.name_local %}
                                        Website in {{ language }}
                                    {% endblocktrans %}{% endlanguage %}">{{ l.name_local }}</a>
                            {% endfor %}
                        </nav>
                    {% endif %}
                    {% include "pretixpresale/fragment_login_status.html" %}
                </div>
            {% endif %}
        {% endif %}
        <div class="clearfix"></div>
    </div>
    {% if messages %}
        {% for message in messages %}
            <div class="alert {{ message.tags }}">
                {{ message }}
            </div>
        {% endfor %}
    {% endif %}
    {% block content %}
    {% endblock %}
{% endblock %}
{% block footernav %}
    {% if not request.event and request.organizer.settings.contact_mail %}
        <li><a href="mailto:{{ request.organizer.settings.contact_mail }}" target="_blank" rel="noopener">{% trans "Contact event organizer" %}</a></li>
    {% endif %}
    {% if not request.event and request.organizer.settings.privacy_url %}
        <li><a href="{% safelink request.organizer.settings.privacy_url %}" target="_blank" rel="noopener">{% trans "Privacy policy" %}</a></li>
    {% endif %}
    {% if not request.event and request.organizer.settings.cookie_consent and cookie_providers %}
        <li><button type="button" class="btn btn-link" id="cookie-consent-reopen">{% trans "Cookie settings" %}</button></li>
    {% endif %}
    {% if not request.event and request.organizer.settings.imprint_url %}
        <li><a href="{% safelink request.organizer.settings.imprint_url %}" target="_blank" rel="noopener">{% trans "Imprint" %}</a></li>
    {% endif %}
{% endblock %}
