{% extends "orga/schedule/base.html" %}
{% load i18n %}

{% block schedule_content %}
<h2>Exports</h2>
<p>
{% blocktrans trimmed %}
pretalx provides a range of exports. If none of these match what you are looking
for, you can also provide a custom plugin to export the data – please ask
your administrator to install the plugin.
{% endblocktrans %}
</p>

<hr>
<h3>{% trans "HTML Export" %}</h3>

<p>
{% blocktrans trimmed %}
The event schedule can be exported to a static HTML dump, so you can upload it
to a normal file-serving web server like nginx. This is done automatically on
schedule release, but you can also trigger that action here.
{% endblocktrans %}
</p>

<div class="submit-group"><span></span><span>
    <a href='{{ request.event.orga_urls.schedule_export_download }}' class="btn btn-lg btn-info">
        <i class="fa fa-download"></i>
        {% trans "Download ZIP" %}
    </a>
    <form action="{{ request.event.orga_urls.schedule_export_trigger }}" method="POST" class="d-inline-block">
        {% csrf_token %}
        <button type="submit" class="btn btn-lg btn-success">
            <i class="fa fa-refresh"></i>
            {% trans "Regenerate Export" %}
        </button>
    </form>
</span>
</div>

<h3>{% trans "Data Export" %}</h3>
{% if not request.event.current_schedule %}
<div class="alert alert-warning">
    {% blocktrans trimmed %}
    You haven't released a schedule yet – many of these data exporters only work on a released schedule.
    {% endblocktrans %}
</div>
{% endif %}
<ul>
    {% for exporter in exporters %}
    <li>
        <a href="{{ exporter.urls.base }}">
            {% if exporter.icon|slice:":3" == "fa-" %}
                <i class="fa {{ exporter.icon }}"></i>
            {% else %}
                {{ exporter.icon }}
            {% endif %}
            {{ exporter.verbose_name }}
            {% if exporter.show_qrcode %}
                <span class="export-qrcode">
                  <div class="btn btn-default btn-sm">
                      <i class="fa fa-qrcode"></i>
                  </div>
                  <div class="export-qrcode-image btn btn-default">{{ exporter.get_qrcode }}</div>
                </span>
            {% endif %}
        </a>
    </li>
    {% endfor %}
</ul>

<hr>
<h3>{% trans "API" %}</h3>

{% trans "You can also use the API to export or use data." %}

<div class="submit-group"><span></span><span>
    <a class="btn btn-lg btn-info" href="https://docs.pretalx.org/en/latest/api/index.html">
        <i class="fa fa-book"></i>
        {% trans "Documentation" %}
    </a>
    <a class="btn btn-lg btn-success" href="{{ request.event.api_urls.base }}">
        {% trans "Go to API" %}
    </a>
</span>
</div>

{% endblock %}
