{% comment %} The progress bar and the report for one import run. Polled while a run is working and inert once it is not: `hx-trigger` carries the poll interval only for a running row, so a finished import is not a request every two seconds for as long as somebody leaves the tab open. `importChanged` also refreshes it, so pressing "Check the file" or "Import" redraws this panel without a reload. {% endcomment %}

{{ run.get_status_display }}

{% if run.total_rows %} {{ run.processed_rows }} of {{ run.total_rows }} rows {% endif %}
{% if run.is_running or run.total_rows %}
{% endif %}

{{ run.created_count }} created · {{ run.updated_count }} updated · {{ run.skipped_count }} skipped · {{ run.error_count }} error{{ run.error_count|pluralize }} {% if run.status == "validated" %}
Nothing has been written yet. These are the numbers the import would produce. {% endif %}

{% if run.errors %}

Rows that will not import

{% for error in run.errors|slice:":20" %} {% endfor %}
RowColumnProblem
{{ error.row }} {{ error.column|default:"N/A" }} {{ error.message }}
{% if run.error_count > 20 %}

Showing 20 of {{ run.error_count }}. Download the report for the rest.

{% endif %} {% if run.errors_truncated %}

Only the first {{ run.errors|length }} row errors were stored; the remaining {{ run.hidden_error_count }} were counted but not recorded.

{% endif %}

Download the report (CSV)

{% endif %} {% if run.status == "validated" %}
Rows listed above are skipped; everything else is written.
{% endif %}