{% extends "layouts/base.html" %}
{% load i18n admin_urls static %}

{% block extrastyle %}
    <link rel="stylesheet" type="text/css" href="{% static "assets/css/forms.css" %}">
{% endblock %}

{% block breadcrumbs %}
    <div class="page-header">
        <div class="page-block">
          <div class="row align-items-center">
            <div class="col-md-12">
              <div class="page-header-title">
                <h5 class="m-b-10">{{ opts.verbose_name_plural|capfirst }}</h5>
              </div>
              <ul class="breadcrumb">
                <li class="breadcrumb-item"><a href="#"><i class="feather icon-home"></i></a></li>
                <li class="breadcrumb-item"><a href="javascript:">{{ opts.app_config.verbose_name }}</a></li>
                <li class="breadcrumb-item"><a href="javascript:">{{ opts.verbose_name_plural|capfirst }}</a></li>
              </ul>
            </div>
          </div>
        </div>
      </div>
{% endblock %}

{% block content %}
    <div class="row mt-3">
        <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>
{% endblock %}
