2.2 KiB · text History 263b40b
{% extends "root.html" %}
{% block width %}w-full max-w-none{% endblock %}
{% block main_class %}px-3 py-3 sm:px-4 lg:px-5{% endblock %}
{% block layout %}focus{% endblock %}
{% block content %}
<div class="space-y-4 text-left">
  {% include "admin/_mod_nav.html" %}
  <div class="flex flex-wrap items-center justify-between gap-3">
    <h1 class="text-3xl font-bold">Moderation log</h1>
    <div class="flex items-center gap-2">
      <form method="get" action="/admin/log" class="join"><input name="q" value="{{ q or '' }}" placeholder="Filter" class="input input-bordered input-sm join-item w-40"><button class="btn btn-sm join-item" type="submit"><i class="fas fa-filter"></i></button></form>
      {% set toggle_base = "/admin/log" %}{% set view_mode = "focus" %}{% include "forum/_view_toggle.html" %}
    </div>
  </div>
  {% if filter %}<p class="text-sm" data-filter>Entries by or about <a href="/admin/users/{{ filter.id }}" class="link font-medium">{{ filter.username }}</a> · <a href="/admin/log" class="link">everything</a></p>{% endif %}
  {% if not entries %}<p class="rounded-box border border-dashed border-base-300 p-6 text-center text-sm opacity-60">Nothing logged yet.</p>{% endif %}
  <div class="grid grid-cols-[repeat(auto-fill,minmax(20rem,1fr))] items-start gap-3">
    {% for e in entries %}
    <article class="flex flex-col gap-1 rounded-box border border-base-300 bg-base-100 p-3 shadow-sm" data-action="{{ e.action }}">
      <header class="flex items-center justify-between gap-2 text-sm">
        <span class="font-semibold">{{ e.action_label }}</span>
        <span class="text-xs opacity-60" title="{{ e.when_abs }}">{{ e.when }}</span>
      </header>
      <p class="truncate text-sm">{% if e.target_href %}<a href="{{ e.target_href }}" class="link link-hover">{{ e.target_label }}</a>{% else %}{{ e.target_label }}{% endif %}</p>
      {% if e.reason %}<p class="text-xs italic opacity-80">{{ e.reason }}</p>{% endif %}
      <p class="text-xs opacity-60">by {% if e.actor_id %}<a href="/admin/users/{{ e.actor_id }}" class="link link-hover">{{ e.actor }}</a>{% else %}{{ e.actor }}{% endif %}{% if e.source != "web" %} · {{ e.source }}{% endif %}</p>
    </article>
    {% endfor %}
  </div>
</div>
{% endblock %}