{% extends "pretixpresale/base.html" %}
{% load i18n %}
{% load static %}
{% load thumb %}
{% load eventurl %}
{% load safelink %}
{% load rich_text %}
{% block thetitle %}
    {% block title %}{% endblock %}{% if request.resolver_match.url_name != "event.index" %} :: {% endif %}{{ event.name }}
{% endblock %}
{% block custom_header %}
    {% if event.settings.meta_noindex %}
        <meta name="robots" content="noindex, nofollow">
    {% endif %}
    <meta property="og:type" content="website" />
    {% if social_image %}
        <meta property="og:image" content="{{ social_image }}" />
    {% endif %}
    {{ block.super }}
{% endblock %}
{% block above %}
    {% if not event.live %}
        <div class="offline-banner">
            <div class="container">
                <span class="fa fa-user-secret"></span>
                {% trans "This shop is currently only visible to you and your team." %}
                <a href="{{ site_url }}{% url "control:event.live" event=event.slug organizer=event.organizer.slug %}">
                    {% trans "Take it live now" %}
                </a>
            </div>
        </div>
    {% endif %}
    <div class="container page-header-links {% if event.settings.theme_color_background|upper != "#FFFFFF" or event.settings.logo_image_large %}page-header-links-outside{% endif %}">
        {% if event.settings.locales|length > 1 %}
            {% if event.settings.theme_color_background|upper != "#FFFFFF" or event.settings.logo_image_large %}
                <div class="pull-right header-part flip hidden-print">
                    <div class="locales">
                        {% 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">
                                {{ l.name_local }}</a>
                        {% endfor %}
                    </div>
                </div>
            {% endif %}
        {% endif %}
        {% if request.event.settings.organizer_link_back %}
            <div class="pull-left header-part flip hidden-print">
                <a href="{% eventurl request.organizer "presale:organizer.index" %}">
                    &laquo; {% blocktrans trimmed with name=request.organizer.name %}
                    Show all events of {{ name }}
                {% endblocktrans %}
                </a>
            </div>
        {% endif %}
        <div class="clearfix"></div>
    </div>
{% endblock %}
{% block page %}
    <div class="page-header {% if event_logo and event.settings.logo_image_large %}logo-large{% endif %}">
        <div class="{% if not event_logo or not event.settings.logo_image_large %}pull-left flip{% endif %}">
            {% if event_logo and event.settings.logo_image_large %}
                <a href="{% eventurl event "presale:event.index" cart_namespace=cart_namespace|default_if_none:"" %}"
                   title="{{ event.name }}">
                    <img src="{{ event_logo|thumb:'1170x5000' }}" alt="{{ event.name }}" class="event-logo" />
                </a>
            {% elif event_logo %}
                <a href="{% eventurl event "presale:event.index" cart_namespace=cart_namespace|default_if_none:"" %}"
                        title="{{ event.name }}">
                    <img src="{{ event_logo|thumb:'5000x120' }}" alt="{{ event.name }}" class="event-logo" />
                </a>
            {% else %}
                <h1>
                    <a href="{% eventurl event "presale:event.index" cart_namespace=cart_namespace|default_if_none:"" %}">{{ event.name }}</a>
                    {% if request.event.settings.show_dates_on_frontpage and not event.has_subevents %}
                        <small>{{ event.get_date_range_display }}</small>
                    {% endif %}
                </h1>
            {% endif %}
        </div>
        {% if event.settings.locales|length > 1 %}
            {% if event.settings.theme_color_background|upper == "#FFFFFF" and not event.settings.logo_image_large %}
                <div class="{% if not event_logo or not event.settings.logo_image_large %}pull-right flip{% endif %} loginbox hidden-print">
                    <div class="locales">
                        {% 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">
                                {{ l.name_local }}</a>
                        {% endfor %}
                    </div>
                </div>
            {% endif %}
        {% endif %}
        <div class="clearfix"></div>
    </div>
    {% if request.event.testmode %}
        {% if request.sales_channel.testmode_supported %}
            <div class="alert alert-warning">
                <strong>
                    {% trans "This ticket shop is currently in test mode. Please do not perform any real purchases as your order might be deleted without notice." %}
                </strong>
            </div>
        {% else %}
            <div class="alert alert-danger">
                <strong>
                    {% trans "Orders made through this sales channel cannot be deleted - even if the ticket shop is in test mode!" %}
                </strong>
            </div>
        {% endif %}
    {% endif %}
    {% if messages %}
        {% for message in messages %}
            <div class="alert {{ message.tags }}">
                {{ message }}
            </div>
        {% endfor %}
    {% endif %}
    {% if request.event.settings.banner_text %}
        <div class="banner-top">
            {{ request.event.settings.banner_text|rich_text }}
        </div>
    {% endif %}
    {% block content %}
    {% endblock %}
    {% if request.event.settings.banner_text_bottom %}
        <div class="banner-bottom">
            {{ request.event.settings.banner_text_bottom|rich_text }}
        </div>
    {% endif %}
    {% if request.event.testmode %}
        {% if request.sales_channel.testmode_supported %}
            <div class="alert alert-testmode alert-warning">
                <strong>
                    {% trans "This ticket shop is currently in test mode. Please do not perform any real purchases as your order might be deleted without notice." %}
                </strong>
            </div>
        {% else %}
            <div class="alert alert-testmode alert-danger">
                <strong>
                    {% trans "Orders made through this sales channel cannot be deleted - even if the ticket shop is in test mode!" %}
                </strong>
            </div>
        {% endif %}
    {% endif %}
{% endblock %}
{% block footer %}
    {% if request.event.settings.contact_mail %}
        <a href="mailto:{{ request.event.settings.contact_mail }}">{% trans "Contact event organizer" %}</a> &middot;
    {% endif %}
    {% if request.event.settings.imprint_url %}
        <a href="{% safelink request.event.settings.imprint_url %}" target="_blank" rel="noopener">{% trans "Imprint" %}</a>
        &middot;
    {% endif %}
{% endblock %}
