{% extends "admin/import_export/base.html" %} {% load i18n %} {% load admin_urls %} {% load import_export_tags %} {% load static %} {% load simpletags %} {% block extrastyle %}{{ block.super }} {% block css %} {% if "SIMPLEUI_STATIC_OFFLINE"|get_config %} {% else %} {% endif %} {% endblock %} {% endblock %} {% block breadcrumbs_last %} {% trans "Import" %} {% endblock %} {% block content %}
{% if "SIMPLEUI_STATIC_OFFLINE"|get_config %} {% else %} {% endif %} {% 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" %}

{% elif result.has_validation_errors %}

{% trans "Some rows failed to validate" %}

{% trans "Please correct these errors in your data where possible, then reupload it using the form above." %}

{% for field in result.diff_headers %} {% endfor %} {% for row in result.invalid_rows %} {% for field in row.values %} {% endfor %} {% endfor %}
{% trans "Row" %} {% trans "Errors" %}{{ field }}
{{ row.number }} {{ row.error_count }}
    {% for field_name, error_list in row.field_specific_errors.items %}
  • {{ field_name }}
      {% for error in error_list %}
    • {{ error }}
    • {% endfor %}
  • {% endfor %} {% if row.non_field_specific_errors %}
  • {% trans "Non field specific" %}
      {% for error in row.non_field_specific_errors %}
    • {{ error }}
    • {% endfor %}
  • {% endif %}
{{ field }}
{% else %}

{% trans "Preview" %}

{% for field in result.diff_headers %} {% endfor %} {% for row in result.valid_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 %}