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

{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo; {{ title }}
</div>
{% endblock %}

{% block content %}
<div id="content-main">
    <form method="post" enctype="multipart/form-data">
        {% csrf_token %}
        <fieldset class="module aligned">
            <div class="description">
                <p>Upload a CSV file to import {{ opts.verbose_name_plural }}.</p>
                {% if title == "Import Voters" %}
                <p>Expected columns (header mandatory): <strong>voter_id, first_name, last_name, address_street, city, state, zip_code, county, phone, email, district, precinct, registration_date, is_targeted, candidate_support, yard_sign, window_sticker</strong></p>
                {% else %}
                <p>Expected columns (header mandatory): <strong>date, event_type, description</strong></p>
                {% endif %}
            </div>
            {% for field in form %}
            <div class="form-row">
                {{ field.errors }}
                <label class="required" for="{{ field.id_for_label }}">{{ field.label }}:</label>
                {{ field }}
                {% if field.help_text %}
                <div class="help">{{ field.help_text|safe }}</div>
                {% endif %}
            </div>
            {% endfor %}
        </fieldset>
        <div class="submit-row">
            <input type="submit" value="Upload" class="default" name="_save">
        </div>
    </form>
</div>
{% endblock %}
