{% extends 'base.html' %}
{% load export_tags %}

{% block title %} | Export{% endblock %}

{% block main %}
{% include 'export_header.html' %}

<div class="container">
    <div class="row">
        <div class="col-md-12">
            <h3 class="header">
                <span>Manage exports</span>

                {% if exports %}
                    <a role="button" href="{% url 'geokey_export:export_create' %}" class="btn btn-sm btn-success pull-right" data-loader="true">
                        <span class="glyphicon glyphicon-plus"></span>
                        <span>Create new export</span>
                    </a>
                {% endif %}
            </h3>

            <ul class="list-unstyled overview-list">
                {% for export in exports %}
                    <li>
                        <h3><a href="{% url 'geokey_export:export_overview' export.id %}">{{ export.name }}</a></h3>
                        <p class="meta">Expiration: {{ export|expiry }}</p>
                    </li>
                {% empty %}
                    <li>
                        <div class="well empty-list">
                            <p class="lead">We couldn't find any exports you are eligible to manage.</p>
                            <p>You can create a new export to allow data to be accessed.</p>
                            <a role="button" href="{% url 'geokey_export:export_create' %}" class="btn btn-lg btn-success" data-loader="true">Create a new export</a>
                        </div>
                    </li>
                {% endfor %}
            </ul>
        </div>
    </div>
</div>
{% endblock %}
