{% extends "pretixpresale/organizers/base.html" %}
{% load i18n %}
{% load rich_text %}
{% load eventurl %}
{% block title %}{% trans "Event overview" %}{% endblock %}
{% block content %}
    <div>
        {% if organizer_homepage_text %}
            {{ organizer_homepage_text | rich_text }}
        {% endif %}
    </div>
    <h3 class="text-center">{{ date|date:"F Y" }}</h3>
    <form class="form-inline" method="get" id="monthselform" action="{% eventurl request.organizer "presale:organizer.calendar" %}">
        <div class="row">
            <div class="col-sm-4 hidden-xs">
                <a href="{% eventurl request.organizer "presale:organizer.calendar" year=before.year month=before.month %}"
                        class="btn btn-default">
                    <span class="fa fa-arrow-left"></span>
                    {{ before|date:"F Y" }}
                </a>
            </div>
            <div class="col-sm-4 col-xs-12 text-center">
                <select name="month" class="form-control">
                    {% for m in months %}
                        <option value="{{ m|date:"m" }}" {% if m == date %}selected{% endif %}>{{ m|date:"F" }}</option>
                    {% endfor %}
                </select>
                <select name="year" class="form-control">
                    {% for y in years %}
                        <option value="{{ y }}" {% if y == date.year %}selected{% endif %}>{{ y }}</option>
                    {% endfor %}
                </select>
                <button type="submit" class="js-hidden btn btn-default">
                    {% trans "Go" %}
                </button>
            </div>
            <div class="col-sm-4 hidden-xs text-right">
                <a href="{% eventurl request.organizer "presale:organizer.calendar" year=after.year month=after.month %}"
                        class="btn btn-default">
                    <span class="fa fa-arrow-right"></span>
                    {{ after|date:"F Y" }}
                </a>
            </div>
        </div>
    </form>

    {% include "pretixpresale/fragment_calendar.html" %}
    {% if multiple_timezones %}
        <div class="alert alert-info">
            {% blocktrans trimmed %}
                Note that the events in this view are in different timezones.
            {% endblocktrans %}
        </div>
    {% endif %}
    <p class="text-center">
        <a href="{% eventurl request.organizer "presale:organizer.ical" %}?locale={{ request.LANGUAGE_CODE }}"
            class="btn btn-default">
            <span class="fa fa-calendar"></span>
           {% trans "Download calendar as iCal file" %}
        </a>
    </p>

    {% include "pretixpresale/pagination.html" %}
{% endblock %}
