{% extends "admin/base_site.html" %}
{% load i18n admin_urls %}

{% block breadcrumbs %}
    <div class="breadcrumbs{% if LANGUAGE_BIDI %} rbc{% else %} lbc{% endif %}">
        <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
        &rsaquo; {{ opts.app_config.verbose_name }}
        &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
        &rsaquo; <a
            href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
        &rsaquo; {% trans 'History' %}
    </div>
{% endblock %}

{% block content %}
    <div class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-body">
                        {% if action_list %}
                            <div class="table-responsive" style="overflow: hidden;">
                                <table class="table tablesorter {{ direction.panel }}">
                                    <thead class="text-primary">
                                    <tr>
                                        <th scope="col">{% trans 'User' %}</th>
                                        <th scope="col">{% trans 'Action' %}</th>
                                        <th scope="col">{% trans 'Date/time' %}</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for action in action_list %}
                                        <tr>
                                            <td>{{ action.user.get_username }}{% if action.user.get_full_name %} (
                                                {{ action.user.get_full_name }}){% endif %}</td>
                                            <td>{{ action.get_change_message }}</td>
                                            <th scope="row">{{ action.action_time|date:"DATETIME_FORMAT" }}</th>
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        {% else %}
                            <p>{% trans "This object doesn't have a change history. It probably wasn't added via this admin site." %}</p>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
