{% extends 'base.html' %}
{% load helpers %}
{% load form_helpers %}

{% block content %}
{% block tabs %}{% endblock %}
<div class="row">
	<div class="col-md-8 col-md-offset-2">
        <h1>{% block title %}{{ obj_type|bettertitle }} Import{% endblock %}</h1>
        {% if form.non_field_errors %}
            <div class="panel panel-danger">
                <div class="panel-heading"><strong>Errors</strong></div>
                <div class="panel-body">
                    {{ form.non_field_errors }}
                </div>
            </div>
        {% endif %}
        <form action="" method="post" class="form form-horizontal object-import-form">
            {% csrf_token %}
            <div class="panel panel-default">
                <div class="panel-heading">Data</div>
                <div class="panel-body">
                    {% render_field form.data %}
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">Format</div>
                <div class="panel-body">
                    {% render_field form.format %}
                </div>
            </div>
            <div class="form-group text-right">
                <button type="submit" name="_create" class="btn btn-primary">Submit</button>
                <button type="submit" name="_addanother" class="btn btn-primary">Submit and Import Another</button>
                {% if return_url %}
                    <a href="{{ return_url }}" class="btn btn-default">Cancel</a>
                {% endif %}
            </div>
        </form>
	</div>
</div>
{% endblock %}
