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

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

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

{# 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 row in events %} {% endfor %}
{{ t('common.when') }}{{ t('audit.action') }} {{ t('order.who') }}{{ t('audit.concerns') }} {{ t('error.detail') }}
{{ row.occurred_at | moment }}
#{{ row.seq }}
{{ row.action }}
{{ row.outcome }}
{{ row.actor_id }}
{{ row.actor_type }}
{# 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. #} {% 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.request_id %}
req {{ row.request_id }}{% endif %} {% if row.idempotency_key %}
key {{ row.idempotency_key }}{% 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 %}