{% load i18n %}{% comment %} The per-record history panel. Rendered only when the viewer may read the audit log — `history` is None otherwise, not an empty list, because "nobody has touched this record" and "you may not see who has" must not look the same. When django-simple-history is installed and covers this model, its timeline renders *alongside* ours rather than instead of it. The two answer different questions: theirs is what the row looked like at each point, ours is who touched it, from where, and through which panel. Neither is a substitute for the other, which is exactly why we ship our own instead of requiring theirs. {% endcomment %} {% if history is not None %}

{% translate "History" %}

{% if history %}{{ history|length }}{% endif %}
{% if history %}
    {% for entry in history %}
  1. {{ entry.get_action_display }} {% translate "Someone" as unknown_actor %} {{ entry.actor_repr|default:unknown_actor }}
    {% if 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. {% endfor %}
{% if history|length >= history_limit and audit_url %} {% comment %} One blocktranslate for both sentences: the link text is part of the thought, and languages that front the call to action need to move it. {% endcomment %}
{% blocktranslate count counter=history_limit with url=audit_url %}Showing the most recent entry. Open the full audit log.{% plural %}Showing the most recent {{ counter }} entries. Open the full audit log.{% endblocktranslate %}
{% endif %} {% else %}
{% translate "Nothing has been done to this record through the panel." %}
{% endif %} {% if history_timeline %}

{% translate "Row history" %}

{% comment %} "django-simple-history" is a package name, so it stays inside the sentence as a literal rather than becoming a placeholder. {% endcomment %}

{% translate "From django-simple-history." %}

    {% for revision in history_timeline %}
  1. {{ revision.type }} {{ revision.user|default:"—" }}
    {% if revision.reason %}

    {{ revision.reason }}

    {% endif %}
  2. {% endfor %}
{% endif %}
{% endif %}