{% extends "base.html" %} {% block title %}{{ _("Audit Log") }}{% endblock %} {% block content %}

history {{ _("Audit Log") }} {% if locked %} MAX {% endif %}

{{ _("A record of all ticket actions and account events in your workspace.") }}

{% if not locked %} {% trans count=total_count %}{{ count }} event{% pluralize %}{{ count }} events{% endtrans %} {% endif %}
{% if locked %} {# ── Upsell / locked state ── #}
lock

{{ _("Audit Log requires the MAX plan") }}

{% trans %}Track every ticket action, status change, and account event with a full searchable history. Available on MAX.{% endtrans %}

{% elif logs %} {# ── Log table ── #}
{% for log in logs %} {% endfor %}
{{ _("Timestamp") }} {{ _("Actor") }} {{ _("Action") }} {{ _("Details") }} {{ _("IP") }}
{{ log.created_at|localdt('%Y-%m-%d %H:%M:%S') if log.created_at else '—' }} {% if log.actor == 'System' %} smart_toy {{ _("System") }} {% else %} {{ log.actor }} {% endif %} {{ log.action | audit_action }} {% if log.payload_json %} {{ log.payload_json[:120] }}{% if log.payload_json | length > 120 %}…{% endif %} {% else %} {% endif %} {{ log.ip_address or '—' }}
{# ── Pagination ── #} {% if total_pages > 1 %}
{{ _("Page %(page)s of %(total_pages)s", page=page, total_pages=total_pages) }}
{% if page > 1 %} chevron_left {{ _("Prev") }} {% endif %} {% if page < total_pages %} {{ _("Next") }} chevron_right {% endif %}
{% endif %}
{% else %} {# ── Empty state ── #}
history

{{ _("No audit events yet") }}

{{ _("Events will appear here as your team uses ModuleDesk.") }}

{% endif %}
{% endblock %}