{% extends "tinyforum/base.html" %}

{% load fineforms i18n static %}

{% block extra-body-class %}forum{% endblock %}

{% block lead-title %}
  <h1>{% trans "Moderation" %}</h1>
{% endblock %}

{% block main-region-content %}

<div class="row">
  <section class="small-12 columns">

    {% if object_list %}
      <ul class="report-list">
      {% for report in object_list %}
        <li class="report-list__row">
          <article>
            <div class="report-list__report">
            <h2>{% trans "Report by" %} {{ report.authored_by.profile }} {% trans "at" %} <time datetime="{{ report.created_at|date:'Y-m-d\TH:i' }}">{{ report.created_at|date:'d.m.Y H:i' }}</time>:</h2>
            <h3>{% trans "Reason" %}:</h3>
            <p>{{ report.get_reason_display }}</p>

            {% if report.notes|length > 0 %}
              <h3>{% trans "Notes" %}:</h3>
              <p>{{ report.notes|linebreaksbr }}</p>
            {% endif %}
            </div>
            <div class="report-list__post">
            <h3>{% trans "Post" %}:</h3>
            {% trans "By" %} {{ report.post.authored_by.profile }} {% trans "at" %} <time datetime="{{ report.post.created_at|date:'Y-m-d\TH:i' }}">{{ report.post.created_at|date:'d.m.Y H:i' }}</time> {% trans "in" %} <a href="{{ report.post.thread.get_absolute_url }}">{{ report.post.thread }}</a>:
            <div class="report-list__post-content">
              {{ report.post.text|safe }}
            </div>
            </div>
            <a href="{% url 'tinyforum:report-handle' pk=report.pk %}" class="report-link">Handle</a>
          </article>
        </li>
      {% endfor %}
      </ul>
    {% else %}
      <h2>{% trans 'Yay, all reports have been handled!' %}</h2>
      <p>
        {% trans 'Note! Your own reports, if there are any, are not visisble to you.' %}
      </p>
    {% endif %}

    {% include "tinyforum/pagination.html" %}

  </section>
</div>

{% endblock %}
