{% extends 'base.html.twig' %}

{% block head %}
  {{ include('_includes/meta_pagination.html.twig', { pager: logs }, with_context=false) }}
{% endblock head %}

{% block title 'title.global_moderation_log'|trans %}

{% block body %}
  {% from '_macros/time.html.twig' import relative_time %}
  {% from 'forum/_macros.html.twig' import log_line %}
  <h1 class="page-heading">{{ block('title') }}</h1>

  {% if logs|length > 0 %}
    <div class="text-flow">
      <ul class="moderation-log">
        {% for entry in logs %}
          <li class="moderation-log__entry moderation-log__entry--{{ entry.action|replace({'_': '-'}) }}">
            <p>
              <a href="{{ path('moderation_log', { forum_name: entry.forum.name }) }}">/f/{{ entry.forum.name }}</a>
              &mdash;
              {{ log_line(entry) }}
              &mdash;
              {{ relative_time(entry.timestamp) }}
            </p>
          </li>
        {% endfor %}
      </ul>
    </div>

    {{ include('_includes/pagination.html.twig', { pager: logs }, with_context=false) }}
  {% else %}
    <p class="no-entries">
      <small class="fg-muted text-md">{{ 'flash.no_entries_to_display'|trans }}</small>
    </p>
  {% endif %}
{% endblock body %}

