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

{% block breadcrumbs %}
  {% if not is_popup %}
    <div class="breadcrumbs">
      <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
      &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
      &rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
      &rsaquo; {% translate 'History' %}
    </div>
  {% endif %}
{% endblock %}

{% block content %}
<div id="content-main" class="lucus-content">
  <div class="module">
    {% if action_list %}
      <table id="change-history" class="table table-striped">
        <thead>
          <tr>
            <th scope="col">{% translate 'Date/time' %}</th>
            <th scope="col">{% translate 'User' %}</th>
            <th scope="col">{% translate 'Action' %}</th>
          </tr>
        </thead>
        <tbody>
          {% for action in action_list %}
            <tr>
              <th scope="row">{{ action.action_time|date:"DATETIME_FORMAT" }}</th>
              <td>{{ action.user.get_username }}{% if action.user.get_full_name %} ({{ action.user.get_full_name }}){% endif %}</td>
              <td>{{ action.get_change_message }}</td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
      {% if pagination_required %}
        <p class="paginator">
          {% for i in page_range %}
            {% if i == action_list.paginator.ELLIPSIS %}
              {{ action_list.paginator.ELLIPSIS }}
            {% elif i == action_list.number %}
              <span class="this-page">{{ i }}</span>
            {% else %}
              <a href="?page={{ i|urlencode }}">{{ i }}</a>
            {% endif %}
          {% endfor %}
        </p>
        <p>{{ action_list.paginator.count }} {% blocktranslate count counter=action_list.paginator.count %}entry{% plural %}entries{% endblocktranslate %}</p>
      {% endif %}
    {% else %}
      <p>{% translate 'This object doesn’t have a change history. It probably wasn’t added via this admin site.' %}</p>
    {% endif %}
  </div>
</div>
{% endblock %}
