{% extends "vantage/base.html" %} {% load static vantage i18n %} {% block head %}{% endblock %} {% block content %}

{{ page_title }}

{{ page_description }}

{% comment %} A GET form rather than a rail of links: three filters that combine, two of which are free-form dates, is a form. The page number is deliberately not carried across a filter change — staying on page 7 of a result set you just narrowed to nine rows is the classic pagination bug, and here it looks like the filter returned nothing. {% endcomment %}
{% if entries %} {% comment %} A different "From" to the date filter above — this column holds the originating IP address, so it is marked with its own context. {% endcomment %} {% for row in entries %} {% endfor %}
{% translate "When" %} {% translate "Who" %} {% translate "What" %} {% translate "Record" %} {% translate "Changes" %}{% translate "From" context "network origin of an audit entry" %}
{{ row.entry.actor_repr|default:"—" }} {{ row.entry.get_action_display }} {% if row.entry.action_name %} {{ row.entry.action_name }} {% endif %} {% comment %} The stored label, never a dereference of the generic FK. That row is gone for exactly the entries people care most about. {% endcomment %} {% if row.url %} {{ row.entry.object_repr }} {% else %} {{ row.entry.object_repr|default:"—" }} {% endif %} {% if row.model %}{{ row.model }}{% endif %} {% if row.changes %} {% comment %} Collapsed by default. A delete snapshots every field, and expanding a hundred of them by default turns a scannable log into a wall. {% endcomment %}
{% blocktranslate count counter=row.changes|length %}{{ counter }} field{% plural %}{{ counter }} fields{% endblocktranslate %}
{% for change in row.changes %}
{{ 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 %}
{% else %} — {% endif %}
{{ row.entry.ip_address|default:"—" }}
{% elif has_filters %} {# State 2: the predicate returned nothing. Never a create CTA — nothing here is created by hand. #}
{% icon "search" class="v-empty-icon" %}

{% translate "Nothing matches those filters." %}

{% translate "Widen the date range, or clear the filters to see everything." %}

{% translate "Clear filters" %}
{% else %} {# State 1: nothing has happened yet. #}
{% icon "activity" class="v-empty-icon" %}

{% translate "Nothing has been recorded yet." %}

{% blocktranslate trimmed %} Entries appear here as soon as someone creates, changes or deletes a record through this panel. {% endblocktranslate %}

{% endif %}
{% if page.paginator.num_pages > 1 %}
{% blocktranslate with start=page.start_index end=page.end_index total=paginator.count %}{{ start }}–{{ end }} of {{ total }}{% endblocktranslate %}
{% if page.has_previous %} {% translate "Previous" %} {% else %} {% endif %} {% if page.has_next %} {% translate "Next" %} {% else %} {% endif %}
{% endif %} {% endblock %}