{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load order_overview %}
{% block title %}{% trans "Data export" %}{% endblock %}
{% block content %}
	<h1>
        {% trans "Data export" %}
        {% if "identifier" in request.GET %}
            <a href="?" class="btn btn-default">{% trans "Show all" %}</a>
        {% endif %}
    </h1>
    {% for e in exporters %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <a class="collapsed" data-toggle="collapse" href="#{{ e.identifier }}">
                        {{ e.verbose_name }}
                        <i class="fa fa-angle-down collapse-indicator"></i>
                    </a>
                </h3>
            </div>
            <div id="{{ e.identifier }}" class="panel-collapse collapse {% if "identifier" in request.GET %}in
{% endif %}">
                <div class="panel-body">
                    <form action="{% url "control:event.orders.export.do" event=request.event.slug organizer=request.organizer.slug %}"
                            method="post" class="form-horizontal" data-asynctask data-asynctask-download
                            data-asynctask-long>
                        {% csrf_token %}
                        <input type="hidden" name="exporter" value="{{ e.identifier }}" />
                        {% bootstrap_form e.form layout='horizontal' %}
                        <button class="btn btn-primary pull-right" type="submit">
                            <span class="icon icon-upload"></span> {% trans "Start export" %}
                        </button>
                    </form>
                </div>
            </div>
        </div>
    {% endfor %}
{% endblock %}
