Files
2026-06-17 17:06:43 -04:00

49 lines
2.0 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ _('Admin · Audit log') }}{% endblock %}
{% block content %}
{% include "admin/_nav.html" %}
<div class="card">
<h2>{{ _('Audit log') }}</h2>
<form method="get" class="admin-filter-row">
<div class="field">
<label>{{ _('Action filter') }}</label>
<input class="input" name="action" value="{{ filters.get('action', '') }}" placeholder="e.g. listing.removed">
</div>
<button class="btn ghost" type="submit">{{ _('Filter') }}</button>
{% if filters.get('action') %}<a class="btn ghost" href="{{ url_for('admin.audit_log') }}">{{ _('Clear') }}</a>{% endif %}
</form>
<table class="list">
<thead><tr>
<th>{{ _('When') }}</th>
<th>{{ _('Actor') }}</th>
<th>{{ _('Action') }}</th>
<th>{{ _('Target') }}</th>
<th>{{ _('Meta') }}</th>
</tr></thead>
{% for entry in pagination.items %}
<tr>
<td class="muted small">{{ entry.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
<td>
{% if entry.actor %}
<a href="{{ url_for('admin.user_detail', user_id=entry.actor_id) }}">{{ entry.actor.display_name }}</a>
{% else %}<span class="muted"></span>{% endif %}
</td>
<td><code>{{ entry.action }}</code></td>
<td class="muted small">{{ entry.target_type }}{% if entry.target_id %}:{{ entry.target_id }}{% endif %}</td>
<td class="muted small">{{ entry.meta or '' }}</td>
</tr>
{% else %}
<tr><td colspan="5" class="muted">{{ _('No entries.') }}</td></tr>
{% endfor %}
</table>
<div class="pager">
{% if pagination.has_prev %}<a href="{{ url_for('admin.audit_log', **merge_query(page=pagination.prev_num)) }}">&larr; {{ _('Prev') }}</a>{% endif %}
<span class="muted">{{ _('Page %(p)s of %(t)s', p=pagination.page, t=pagination.pages) }}</span>
{% if pagination.has_next %}<a href="{{ url_for('admin.audit_log', **merge_query(page=pagination.next_num)) }}">{{ _('Next') }} &rarr;</a>{% endif %}
</div>
</div>
{% endblock %}