{% extends "base.html" %} {% from "components/pagination.html" import render_pagination %} {% from "components/empty_state.html" import empty_state %} {% block title %}Audit Logs · Admin{% endblock %} {% set category_badge = {'premium': 'warning', 'listing': 'primary', 'advertisement': 'info', 'user': 'secondary', 'bulk': 'dark', 'reward': 'success', 'report': 'danger'} %} {% macro card(label, value, icon, color) %}
{{ value }}
{{ label }}
{% endmacro %} {% block content %}

Audit Logs

Append-only, read-only trail of every administrative action.

Analytics
{# ---------- Summary ---------- #} {% set s = summary %}
{{ card('Total Events', "{:,}".format(s.total_events), 'bi-list-columns-reverse', 'primary') }} {{ card('Today', "{:,}".format(s.today_events), 'bi-calendar-day-fill', 'info') }} {{ card('Premium', "{:,}".format(s.premium_actions), 'bi-star-fill', 'warning') }} {{ card('Listing', "{:,}".format(s.listing_actions), 'bi-box-seam-fill', 'primary') }} {{ card('Advertisement', "{:,}".format(s.advertisement_actions), 'bi-megaphone-fill', 'info') }} {{ card('Bulk', "{:,}".format(s.bulk_actions), 'bi-collection-fill', 'secondary') }}
{# ---------- Filters (sticky) ---------- #}
{# ---------- Table ---------- #}
{% for r in rows %} {% set is_highlight = highlight and (r.id|string == highlight) %} {# Expandable detail row (read-only) #} {% else %} {% endfor %}
TimestampAdministratorAction Entity TypeEntity NamePublic IDSummary
{{ r.admin_name }} {{ r.admin_email }}
{{ r.label }} {% if r.entity_type %}{{ r.entity_type }}{% else %}—{% endif %} {{ r.entity_name or '—' }} {% if r.entity_public_id %}{{ r.entity_public_id[:8] }}{% else %}—{% endif %} {% for k, v in r.details.items() %}{{ k }}: {{ v }}{% if not loop.last %} · {% endif %}{% endfor %}
Administrator
{{ r.admin_name }} ({{ r.admin_email }})
Action
{{ r.label }} {{ r.action }}
Timestamp
{{ r.created_at.strftime('%d %b %Y, %H:%M:%S') }} UTC
Entity
{{ (r.entity_type or '—')|capitalize }}{% if r.entity_name %} · {{ r.entity_name }}{% endif %}
{% if r.entity_public_id %}
Entity Public ID
{{ r.entity_public_id }}
{% endif %}
IP hash
{{ r.ip_hash or '—' }}
User-agent hash
{{ r.user_agent_hash or '—' }}
Full details
{{ r.details | tojson(indent=2) }}
{{ empty_state('bi-shield-check', 'No audit events found.', 'Administrative actions will be recorded here as they happen.', reset_label='Reset filters', reset_url=url_for('admin.audit_logs'), compact=true) }}
{{ render_pagination(pagination, 'admin.audit_logs', filter_args) }}
{% endblock %}