{% extends "page_view.html" %} {% load i18n humanize %} {% block page.actions %} {% translate "Past imports" %} {% endblock page.actions %} {% block page.content %}
{% for warning in warnings %}
{{ warning }}
{% endfor %} {# ---- What is happening now, and what to do next ---- #} {% if job.is_running %} {% if job.status == "undoing" %}{% translate "Putting the records back" as running_title %}{% elif job.status == "importing" %}{% translate "Writing the records" as running_title %}{% else %}{% translate "Reading every row" as running_title %}{% endif %}

{% if job.status == "undoing" %}{% translate "The undo runs in the background. You can leave this page; the undo carries on and the import is listed under Past imports." %} {% elif job.status == "importing" %}{% translate "The import runs in the background. You can leave this page; the import carries on and is listed under Past imports." %} {% else %}{% translate "Each row is matched to a record and every cell is read. Nothing is written yet. You can leave this page and come back." %}{% endif %}

{% elif job.status == "failed" %}

{{ job.error }}

{% elif job.status == "problems" %} {% blocktranslate count n=job.summary.problem|default:0 asvar problems_title %}{{ n }} row needs changes before the file can be imported{% plural %}{{ n }} rows need changes before the file can be imported{% endblocktranslate %} {% if job.error %}

{{ job.error }}

{% endif %}

{% translate "A file goes in whole or not at all, so nothing has been written. Download the file with each problem written beside its row, correct it, and upload it again." %}

{% if job.file %} {% translate "Download the file with its problems marked" %}{% endif %} {% translate "Upload a corrected file" %}
{% csrf_token %}
{% elif job.status == "nothing" %}

{% blocktranslate count n=job.row_count %}The row matches a stored record exactly, or is left out.{% plural %}All {{ n }} rows match stored records exactly, or are left out.{% endblocktranslate %}

{% elif job.status == "checked" %}

{% if job.summary.new and job.summary.update %} {% blocktranslate with a=job.summary.new u=job.summary.update type=job.type_name %}Importing adds {{ a }} new {{ type }} and changes {{ u }}.{% endblocktranslate %} {% elif job.summary.new %} {% blocktranslate with a=job.summary.new type=job.type_name %}Importing adds {{ a }} new {{ type }}.{% endblocktranslate %} {% else %} {% blocktranslate with u=job.summary.update type=job.type_name %}Importing changes {{ u }} {{ type }}. It adds none.{% endblocktranslate %} {% endif %} {% if job.summary.unchanged %}{% blocktranslate count n=job.summary.unchanged %}{{ n }} row matches its record already and is left alone.{% plural %}{{ n }} rows match their records already and are left alone.{% endblocktranslate %}{% endif %} {% translate "Look through the rows below first." %}

{% csrf_token %}
{% elif job.status == "imported" %} {% if job.summary.new and job.summary.update %}{% blocktranslate with a=job.summary.new u=job.summary.update type=job.type_name asvar done_title %}Added {{ a }} {{ type }} and changed {{ u }}{% endblocktranslate %} {% elif job.summary.new %}{% blocktranslate with a=job.summary.new type=job.type_name asvar done_title %}Added {{ a }} {{ type }}{% endblocktranslate %} {% else %}{% blocktranslate with u=job.summary.update type=job.type_name asvar done_title %}Changed {{ u }} {{ type }}{% endblocktranslate %}{% endif %}

{% blocktranslate with who=job.imported_by.get_full_name|default:job.imported_by when=job.imported_at|naturaltime %}Imported by {{ who }} {{ when }}.{% endblocktranslate %}

{% blocktranslate with type=job.type_name %}See the {{ type }}{% endblocktranslate %} {% if undo_blocked %} {% translate "This import can no longer be undone:" %} {% for e in undo_blocked.entries %}{% if e.url %}{{ e.label }}{% else %}{{ e.label }}{% endif %} {{ e.reason }}{% if not forloop.last %}, {% endif %}{% endfor %}{% if undo_blocked.more %} {% blocktranslate count n=undo_blocked.more %}and {{ n }} more{% plural %}and {{ n }} more{% endblocktranslate %}{% endif %}. {% else %} {% endif %}
{% if not undo_blocked %} {% endif %} {% if undo_refusal %}

{% translate "The undo did not go through and nothing was changed. A record the import added or changed may have been edited or deleted since, or a sample it added may now have measurements; undoing would lose that work." %}

    {% for line in undo_refusal %}
  • {{ line }}
  • {% endfor %}
{% endif %} {% elif job.status == "undone" %}

{% blocktranslate with who=job.undone_by.get_full_name|default:job.undone_by when=job.undone_at|naturaltime %}Undone by {{ who }} {{ when }}. The records it added were deleted and the ones it changed got their earlier values back.{% endblocktranslate %}

{% elif job.status == "discarded" %}

{% translate "It was checked and then set aside. Nothing from it was written." %}

{% endif %} {# ---- Every row ---- #} {% if tiles and not job.is_running %} {% if page_rows %}
    {% for row in page_rows %}
  • {% translate "Row" %} {{ row.line }} {{ row.label|default:"—" }}
    {% if row.problem_list %}
      {% for p in row.problem_list %}
    • {% if p.label %}{{ p.label }}{% endif %}{{ p.message }}
    • {% endfor %}
    {% elif row.changes %}
    {% for c in row.changes %}
    {{ c.label }}
    {{ c.old|default:"—" }}{{ c.new|default:_("(empty)") }}
    {% endfor %}
    {% elif row.note %}

    {{ row.note }}

    {% elif row.cells %}
    {% for heading, value in row.cells %}
    {{ heading }}
    {{ value|truncatechars:40 }}
    {% endfor %}
    {% endif %}
  • {% endfor %}
{% if row_page > 1 or has_next %} {% endif %} {% else %}

{% translate "No rows have this outcome." %}

{% endif %}
{% endif %}
{% endblock page.content %}