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


{% block breadcrumb_items %}
  <li class="breadcrumb-item">
    <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
  </li>

  <li class="breadcrumb-item">
    <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
  </li>

  <li class="breadcrumb-item">
    <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
  </li>

  <li class="breadcrumb-item active" aria-current="page">
    <span>{{ _("History") }}</span>
  </li>
{% endblock breadcrumb_items %}


{% block content_title %}
  <h1>
    {{ _("History") }}: <span class="text-secondary">{{ object|truncatewords:"18" }}</span>
  </h1>
{% endblock %}


{% block content %}
  {% if action_list %}
    <table class="paper-table table table-hover table-responsive-sm">
      <thead>
      <tr>
        <th scope="col">{{ _("Date/time") }}</th>
        <th scope="col">{{ _("User") }}</th>
        <th scope="col">{{ _("Action") }}</th>
      </tr>
      </thead>
      <tbody>
      {% for action in action_list %}
        <tr>
          <th scope="row">
            {% if show_log_link %}
              <a href="{% url log_opts|admin_urlname:'change' action.pk|admin_urlquote %}">
                {{ action.action_time|date:"DATETIME_FORMAT" }}
              </a>
            {% else %}
              {{ action.action_time|date:"DATETIME_FORMAT" }}
            {% endif %}
          </th>
          <td>
            {% if show_user_link %}
              <a href="{% url user_opts|admin_urlname:'change' action.user.pk|admin_urlquote %}">
                {{ action.user.get_username }}
                {% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}
              </a>
            {% else %}
              {{ action.user.get_username }}
              {% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}
            {% endif %}
          </td>
          <td>{{ action.get_change_message }}</td>
        </tr>
      {% endfor %}
      </tbody>
    </table>
  {% else %}
    <p class="paper-message paper-message--warning">
      {{ _("This object doesn't have a change history. It probably wasn't added via this admin site.") }}
    </p>
  {% endif %}
{% endblock content %}
