{% extends 'xadmin/base_site.html' %} {% load i18n %} {% load admin_urls %} {% load import_export_tags %} {% trans "Import" %} {% load xadmin_tags %} {% block breadcrumbs %} {% endblock %} {% block nav_title %} {{title}} {% endblock %} {% block content %} {% if confirm_form %}
{% csrf_token %} {{ confirm_form.as_p }}

{% trans "Below is a preview of data to be imported. If you are satisfied with the results, click 'Confirm import'" %}

{% else %}
{% csrf_token %}

{% trans "This importer will import the following fields: " %} {{ fields|join:", " }}

{% for field in form %}
{{ field.errors }} {{ field.label_tag }} {{ field }} {% if field.field.help_text %}

{{ field.field.help_text|safe }}

{% endif %}
{% endfor %}
{% endif %} {% if result %} {% if result.has_errors %}

{% trans "Errors" %}

{% else %}

{% trans "Preview" %}

{% for field in result.diff_headers %} {% endfor %} {% for row in result.rows %} {% for field in row.diff %} {% endfor %} {% endfor %}
{{ field }}
{% if row.import_type == 'new' %} {% trans "New" %} {% elif row.import_type == 'skip' %} {% trans "Skipped" %} {% elif row.import_type == 'delete' %} {% trans "Delete" %} {% elif row.import_type == 'update' %} {% trans "Update" %} {% endif %} {{ field }}
{% endif %} {% endif %} {% endblock %}