{% extends "pretixpresale/organizers/base.html" %}
{% load i18n %}
{% load rich_text %}
{% load eventurl %}
{% load urlreplace %}
{% block title %}{% trans "Event overview" %}{% endblock %}
{% block content %}
    {% if organizer_homepage_text %}
        <div>
            {{ organizer_homepage_text | rich_text }}
        </div>
    {% endif %}
    <h3>{{ date|date:"DATE_FORMAT" }}</h3>
    <form class="form-inline" method="get" id="monthselform"
          action="{% eventurl request.organizer "presale:organizer.index" %}">
        {% for f, v in request.GET.items %}
            {% if f != "date" %}
                <input type="hidden" name="{{ f }}" value="{{ v }}">
            {% endif %}
        {% endfor %}
        <div class="row">
            <div class="col-md-5 col-sm-6 col-xs-12 text-left flip">
                {% include "pretixpresale/fragment_calendar_nav.html" with date=date request=request style="day" %}
            </div>
            <div class="col-md-2 col-sm-4 col-xs-8 text-center">
                <input class="datepickerfield form-control" value="{{ date|date:"SHORT_DATE_FORMAT" }}" name="date">
                <button type="submit" class="js-hidden btn btn-default">
                    {% trans "Go" %}
                </button>
            </div>
            <div class="col-md-5 col-sm-2 col-xs-4 text-right flip">
                {% if has_before %}
                    <a href="?{% url_replace request "date" before.date.isoformat %}"
                       class="btn btn-default" data-save-scrollpos aria-label="{{ before|date:"SHORT_DATE_FORMAT" }}">
                        <span class="fa fa-arrow-left" aria-hidden="true"></span>
                        <span class="hidden-sm hidden-xs">{{ before|date:"SHORT_DATE_FORMAT" }}</span>
                    </a>
                {% endif %}
                {% if has_after %}
                    <a href="?{% url_replace request "date" after.date.isoformat %}"
                       class="btn btn-default" data-save-scrollpos aria-label="{{ after|date:"SHORT_DATE_FORMAT" }}">
                        <span class="hidden-sm hidden-xs">{{ after|date:"SHORT_DATE_FORMAT" }}</span>
                        <span class="fa fa-arrow-right" aria-hidden="true"></span>
                    </a>
                {% endif %}
            </div>
        </div>
    </form>
    {% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
    {% include "pretixpresale/fragment_day_calendar.html" with show_avail=request.organizer.settings.event_list_availability %}
    <div class="col-sm-4 visible-xs text-center">
        {% if has_before %}
            <a href="?{% url_replace request "date" before.date.isoformat %}"
               class="btn btn-default">
                <span class="fa fa-arrow-left" aria-hidden="true"></span>
                {{ before|date:"SHORT_DATE_FORMAT" }}
            </a>
        {% endif %}
        {% if has_after %}
            <a href="?{% url_replace request "date" after.date.isoformat %}"
               class="btn btn-default">
                {{ after|date:"SHORT_DATE_FORMAT" }}
                <span class="fa fa-arrow-right" aria-hidden="true"></span>
            </a>
        {% endif %}
    </div>

    {% if multiple_timezones %}
        <div class="alert alert-info">
            {% blocktrans trimmed %}
                Note that the events in this view are in different timezones.
            {% endblocktrans %}
        </div>
    {% endif %}
{% endblock %}
