{% extends 'wagtailadmin/reports/base_report.html' %}
{% load i18n wagtailadmin_tags %}

{% block results %}
    {% if object_list %}
        <table class="listing">
            <thead>
                <tr>
                    <th class="title">
                        {% trans 'Name' %}
                    </th>
                    <th>
                        {% trans 'Type' %}
                    </th>
                    <th>
                        {% trans 'Action' %}
                    </th>
                    <th>
                        {% trans 'User' %}
                    </th>
                    <th class="updated">
                        {% trans 'Date / Time' %}
                    </th>
                </tr>
            </thead>
            <tbody>
                {% for entry in object_list %}
                    <tr>
                        <td class="title">
                            {% if entry.edit_url %}
                                <a href="{{ entry.edit_url }}" title="{% trans 'Edit this item' %}">{{ entry.label }}</a>
                            {% else %}
                                {{ entry.label }}
                            {% endif %}
                        </td>
                        <td>
                            {{ entry.content_type|format_content_type }}
                        </td>
                        <td>
                            {{ entry.message }}
                        </td>
                        <td>
                            {% include "wagtailadmin/shared/user_avatar.html" with user=entry.user username=entry.user_display_name %}
                        </td>
                        <td class="updated">
                            <div class="human-readable-date" title="{{ entry.timestamp|date:"DATETIME_FORMAT" }}">{% blocktrans trimmed with time_period=entry.timestamp|timesince %}{{ time_period }} ago{% endblocktrans %}</div>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p>{% trans "No log entries found." %}</p>
    {% endif %}
{% endblock %}

{% block no_results %}
    <p>{% trans "No log entries found." %}</p>
{% endblock %}
