{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% load l10n %}
{% load wagtailadmin_tags wagtailimages_tags static %}
{% block titletag %}
    {% blocktranslate trimmed with title=page.get_admin_display_title %}
        Stations Loader {{ title }}
    {% endblocktranslate %}
{% endblock %}

{% block extra_css %}
    {{ block.super }}

    {{ form_media.css }}
{% endblock %}

{% block content %}
    {% trans "Stations Loader" as header_str %}

    {% include "wagtailadmin/shared/header.html" with title=header_str icon="upload" %}

    <div class="nice-padding">
        <div style="margin-top: 40px;"
             id="upload_form_wrapper">
            <form action="{% url 'geomanager_load_stations' %}" method="POST"
                  enctype="multipart/form-data">
                {% if form.non_field_errors %}
                    <div class="non-field_errors" style="margin-bottom: 20px">
                        {% include "wagtailadmin/shared/non_field_errors.html" with form=form %}
                    </div>
                {% endif %}
                <ul class="fields">
                    {% csrf_token %}
                    {% for field in form %}
                        {% if field.is_hidden %}
                            {{ field }}
                        {% else %}
                            {% include "wagtailadmin/shared/field_as_li.html" %}
                        {% endif %}
                    {% endfor %}
                    <li>
                        <button type="submit" class="button">
                            {% translate "Upload" %}
                        </button>
                    </li>
                </ul>
            </form>
        </div>
    </div>
{% endblock %}

{% block extra_js %}
    {{ block.super }}
    {{ form_media.js }}
{% endblock %}