{# Partial: audit log results table. Used by: - audit/list.html (full page) - /audit/tail endpoint (HTMX live polling) Context: - logs: list of AuditLog - search, event_type, action, outcome: current filters - page, per_page, total, total_pages: pagination - live_tail: bool — when true, the wrapping div polls /audit/tail and renders a "live" badge This partial owns the wrapping `
` so it can replace itself on swap. #}
{% if live_tail %}
Live — refreshing every 10s
{% endif %} {% if logs %} {% for log in logs %} {% endfor %}
Timestamp Event Subject Resource Outcome View
{{ log.timestamp.strftime('%Y-%m-%d') }} {{ log.timestamp.strftime('%H:%M:%S') }}
{{ log.event_type }} {{ log.action }}
{% if log.subject_id %} {{ log.subject_id[:8] }}... {% else %} - {% endif %} {% if log.resource_type and log.resource_id %} {{ log.resource_type }}:{{ log.resource_id[:8] }}... {% elif log.resource_type %} {{ log.resource_type }} {% else %} - {% endif %} {% if log.outcome == 'success' %} Success {% elif log.outcome == 'failure' %} Failure {% else %} {{ log.outcome or 'Unknown' }} {% endif %} View, {{ log.id }}
{# Pagination only shown for static (non-live) views, since the live tail shows the most recent N events from page 1. #} {% if total_pages and total_pages > 1 and not live_tail %}
{% endif %} {% else %}

No audit logs found

{% if search or event_type or action or outcome %} No events match your current filters. {% else %} No security events have been logged yet. {% endif %}

{% endif %}