{% extends "admin/base_site.html" %}
{% load i18n %}
{% load admin_static %}
{% load admin_urls %}

{% block content %}
<div id="content-main">
    <h1>Import todo list template from a Google Sheet</h1>

    <form action="{{request.path}}" method="post">
        {% csrf_token %}
        <div id="form_{{ form.form_id }}">
          {% for field in form %}
          <div class="aligned">
            <div class="form-row" id="{{ field.id_for_label }}_row">
              <div {% if field.errors %}class="field_error"{% endif %}>
                <span>{{ field.label_tag }}</span>
                <div class="field">
                  {{ field }}
                  {% for err in field.errors %}
                  <span class="error_message">{{ err }}</span>
                  {% endfor %}
                </div>
              </div>
            </div>
          </div>
          {% endfor %}
        </div>

        {% if import_error %}
        <div class="error_message" style="color: red; margin-bottom: 10px;">
          Error: {{ import_error }}
        </div>
        {% endif %}

        <input type="submit" value="Submit" id="form_submit" />
    </form>

</div>
{% endblock %}
