{% extends "vantage/base.html" %} {% load vantage i18n %} {% comment %} A record's history page. Two halves: the record as it was at a chosen point (with the fields that can be restored ticked off one by one), and the timeline the point is chosen from. Every field carries its verdict in words, not only in styling — "cannot be worked out" has to be readable by someone who cannot tell muted grey from black. {% endcomment %} {% block content %}

{{ page_title }}

{{ panel.get_label }} · #{{ object.pk }}

{% if detail_url %}{% translate "Back to record" %}{% endif %}

{% if position %} {% blocktranslate with when=position.at|date:"Y-m-d H:i:s" %}As it was on {{ when }}{% endblocktranslate %} {% else %} {% translate "As it was" %} {% endif %}

{% if reconstruction %} {% if reconstruction.status == "empty" %}

{% translate "Nothing has been done to this record through the panel, so there is no history to go back to." %}

{% elif reconstruction.status == "before_create" %}

{% blocktranslate with when=reconstruction.starts_at|date:"Y-m-d H:i" %}This record did not exist yet. It was created on {{ when }}.{% endblocktranslate %}

{% elif reconstruction.status == "before_history" %}

{% if reconstruction.truncated %} {% blocktranslate count counter=replay_limit with when=reconstruction.starts_at|date:"Y-m-d H:i" %}Only the most recent change is replayed, and it starts on {{ when }}. Nothing earlier can be shown.{% plural %}Only the most recent {{ counter }} changes are replayed, and they start on {{ when }}. Nothing earlier can be shown.{% endblocktranslate %} {% else %} {% blocktranslate with when=reconstruction.starts_at|date:"Y-m-d H:i" %}This record's history starts on {{ when }}. Nothing before that was recorded, so it cannot be shown.{% endblocktranslate %} {% endif %}

{% elif reconstruction.status == "deleted" %}

{% translate "At that point this record had been deleted." %}

{% else %} {% if reconstruction.bulk_runs %}

{% blocktranslate count counter=reconstruction.bulk_runs %}A bulk change ran on these records after this point. It is logged once for the whole run, not per record, so the fields it could have touched are only shown where the history confirms them.{% plural %}{{ counter }} bulk changes ran on these records after this point. They are logged once for each run, not per record, so the fields they could have touched are only shown where the history confirms them.{% endblocktranslate %}

{% endif %} {% if restore_errors %} {% endif %}
{% csrf_token %} {% for key, value in position_fields %}{% endfor %}
{% if offer_restore %}{% endif %} {% for state in reconstruction.fields %} {% if state.masked %} {% elif state.shown %} {% else %} {% endif %} {% if offer_restore %} {% endif %} {% endfor %}
{% translate "Field" %} {% translate "Then" %} {% translate "Now" %}{% translate "Restore" %}
{{ state.label }}•••••••• {{ state.reason }} {{ state.value_display }} {% if not state.known %}{{ state.reason }}{% endif %} {{ state.current_display }}{{ state.reason }} {% if state.current_display %}{{ state.current_display }}{% else %}—{% endif %} {% if state.restorable %} {% endif %}
{% if offer_restore %}
{% translate "Restoring saves the record through its edit form, and is recorded in the audit log." %}
{% elif not reconstruction.changed %}

{% translate "Every field that can be worked out held the same value then as now." %}

{% endif %}
{% if reconstruction.unrecorded %}

{% translate "Not in the history, because the audit log only records fields on the edit form:" %} {{ reconstruction.unrecorded|join:", " }}.

{% endif %} {% endif %} {% elif asked %}

{% translate "That point is not in this record's history." %}

{% else %}

{% translate "Pick a change below, or a date and time, to see this record as it was then." %}

{% endif %}

{% translate "Timeline" %}

{% if timeline %}{{ timeline|length }}{% endif %}
{% if timeline %}
    {% for row in timeline %} {% with entry=row.entry %}
  1. {{ entry.get_action_display }} {% translate "Someone" as unknown_actor %} {{ entry.actor_repr|default:unknown_actor }} {% if entry.agent_id %}{% translate "Agent" %}{% endif %}
    {% translate "As it was after this" %}
    {% if entry.restored_as_of %}

    {% blocktranslate with when=entry.restored_as_of|date:"Y-m-d H:i" %}Restored from history, as of {{ when }}.{% endblocktranslate %}

    {% elif entry.revealed_field %}

    {% blocktranslate with name=entry.revealed_field %}Revealed {{ name }}.{% endblocktranslate %}

    {% elif entry.is_outside_panel %}

    {% translate "Outside the panel" %}

    {% elif entry.action_name %}

    {% blocktranslate with name=entry.action_name %}Ran {{ name }}.{% endblocktranslate %}

    {% endif %} {% if entry.change_list %}
    {% for change in entry.change_list %}
    {{ change.field }}
    {% if change.from is not None %}{{ change.from }}{% endif %} {% if change.from is not None and change.to is not None %} {% endif %} {% if change.to is not None %}{{ change.to }}{% endif %} {% if change.from is None and change.to is None %} {% translate "changed — value not recorded" %} {% endif %}
    {% endfor %}
    {% endif %}
  2. {% endwith %} {% endfor %}
{% if truncated %}

{% blocktranslate count counter=replay_limit %}Showing the most recent change.{% plural %}Showing the most recent {{ counter }} changes.{% endblocktranslate %}

{% endif %} {% else %}

{% translate "Nothing has been done to this record through the panel." %}

{% endif %}
{% endblock %}