{# #956 cycle 8 — audit-history region template. Renders a list of `HistoryChange` objects produced by ``dazzle_back.runtime.audit_visibility.load_history``. The region renderer (cycle 9) populates ``audit_history`` in the template context — a list of HistoryChange dataclasses. Empty list renders the empty-state message. RBAC denial / no-audit-block reaches this template as an empty list (the loader short-circuits there), so the template doesn't need its own gate. #}
{% if audit_history %}
    {% for change in audit_history %}
  1. {% if change.by_user_id %} {{ change.by_user_id }} {% else %} system {% endif %} {{ change.operation }} {% if change.at %} {% endif %}
      {% for f in change.fields %}
    • {{ f.field_name }} {% if change.operation == "create" %} {{ f.decoded_after if f.decoded_after is not none else "" }} {% elif change.operation == "delete" %} {{ f.decoded_before if f.decoded_before is not none else "" }} {% else %} {{ f.decoded_before if f.decoded_before is not none else "" }} {{ f.decoded_after if f.decoded_after is not none else "" }} {% endif %}
    • {% endfor %}
  2. {% endfor %}
{% else %}

No history yet.

{% endif %}