{% extends "base.html" %} {% block title %}{{ t('audit.title') }} — painfree{% endblock %} {% block body %}

{{ t('audit.heading') }}

{{ t('audit.lede') }}

{# Four links rather than a form, so each is a URL an operator can keep and the seven-control form is there for the day somebody needs it. #}

{{ t('audit.quick_everything') }} {{ t('audit.quick_failures') }} {{ t('audit.quick_today') }}

{{ t('audit.all_filters') }}
{# The action values are the audit contract's own vocabulary, read out of the table. They are matched on by anything reading this trail and are never translated. #}
{{ t('audit.clear') }}
{% if events %} {% for group in groups %} {# One operator action and the rows it wrote. They already shared a `request_id`; read as rows of equal weight, one person pressing one button looked like several unrelated things. #} {% if group.request_id and group.rows | length > 1 %} {% endif %} {% for row in group.rows %} 1 %} class="sub"{% endif %}> {% endfor %} {% endfor %}
{{ t('common.when') }}{{ t('audit.action') }} {{ t('audit.concerns') }}{{ t('error.detail') }}
{{ group.rows[0].occurred_at | moment }} · {{ group.rows[0].actor_id }} · {{ t('audit.rows_in_request', count=group.rows | length) }} {{ group.request_id }}
{{ row.occurred_at | moment }} #{{ row.seq }} {{ row.action }} {{ row.outcome }} {{ row.actor_id }} {# The point of the page: from "something happened" to the thing it happened to, without copying an id out of a JSON blob. Only targets this reader may actually open are linked, and the correlation ids sit under the link rather than beside it as a third mono string. #} {% if links[row.event_id] %} {% for link in links[row.event_id] %} {{ t(link.label_key) }} {{ link.value }} {% endfor %} {% else %} {{ t('audit.nothing_addressable') }} {% endif %} {% if row.idempotency_key %}key {{ row.idempotency_key }}{% endif %} {% if row.request_id and not (group.request_id and group.rows | length > 1) %} req {{ row.request_id }}{% endif %} {% if row.detail %}
{{ t('audit.field_count', count=row.detail | length) }}
{{ row.detail | pretty_json }}
{% else %} {% endif %}
{% else %}

{{ t('audit.empty') }}

{% endif %}
{% if older %} {# A cursor on the append sequence rather than an offset: rows arrive while the page is being read, and an offset would show one twice and skip another. #}

{{ t('audit.older') }}

{% endif %}

{{ t('audit.reading_a_row') }}

{{ t('audit.reading_a_row_ids') }}

{{ t('audit.reading_a_row_redaction') }}

{% endblock %}