{% extends "admin/base_site.html" %} {% load i18n %} {% block title %}{{ title }} | {{ site_title|default:"Django site admin" }}{% endblock %} {% block extrastyle %}{{ block.super }} {% endblock %} {% block content %}

{% blocktranslate trimmed %} Upload a CSV or XLSX file, map its columns to fields, preview what would change, then commit. Nothing is written before the preview; rows with errors are skipped and listed. {% endblocktranslate %} {% translate "Download the template (XLSX)" %} · {% translate "CSV" %}

{% if not job %}
{% csrf_token %} {% translate "Back" %}

{% translate "Importable fields" %}

{% for spec in fields %} {% endfor %}
{% translate "Field" %}{% translate "Kind" %}{% translate "Required" %}{% translate "Allowed values" %}
{{ spec.name }}{% if spec.name == key %} ({% translate "matches existing rows" %}){% endif %} {{ spec.kind }} {% if spec.required %}{% translate "yes" %}{% else %}—{% endif %} {% if spec.choices %}{% for value, label in spec.choices %}{{ value }}{% if not forloop.last %}, {% endif %}{% endfor %} {% elif spec.target %}{% blocktranslate with lookup=spec.lookup|default:"id" target=spec.target %}the {{ lookup }} of a {{ target }}{% endblocktranslate %} {% else %}—{% endif %}
{% else %}

{{ job.original_name }} — {{ job.rows_total }} {% translate "rows" %}, {% translate "status" %}: {{ job.get_status_display }}

{% if state.status == "uploaded" or state.status == "failed" %} {% if state.error %}{% endif %}
{% csrf_token %}

{% translate "Map columns to fields" %}

{% for column in columns %} {% endfor %}
{% translate "Column in the file" %}{% translate "Field" %}
{{ column.header }}
{% translate "Upload another file" %}
{% elif state.status == "previewing" or state.status == "committing" %}

{{ state.rows_done }} / {{ state.rows_total }}

{% translate "Running in the background; this page refreshes itself." %}

{% else %} {% with result=state.result %}
{{ result.created }}{% translate "created" %}
{{ result.updated }}{% translate "updated" %}
{{ result.skipped }}{% translate "skipped" %} ({{ result.unchanged }} {% translate "unchanged" %}, {{ result.errors }} {% translate "with errors" %})
{% endwith %} {% if state.problems %}

{% translate "Rows with errors" %}

{% for problem in state.problems %} {% endfor %}
{% translate "Row" %}{% translate "Field" %}{% translate "Problem" %}
{{ problem.row }}{{ problem.field|default:"—" }}{{ problem.message }}
{% endif %}
{% csrf_token %} {% if state.status == "previewed" %} {% else %} {% translate "Done." %}{% if state.batch %} {% translate "Change batch" %} #{{ state.batch }}.{% endif %} {% translate "Back to the list" %} {% translate "Import another file" %} {% endif %}
{% endif %} {% endif %}
{% endblock %}