{% extends "admin/object_history.html" %}
{% load i18n %}
{% load url from future %}


{% block content %}
  <div id="content-main">

    <p>{% blocktrans %}Choose a date from the list below to revert to a previous version of this object.{% endblocktrans %}</p>

    <div class="module">
      {% if action_list %}
        <table id="change-history" class="table table-bordered table-striped">
          <thead>
            <tr>
              <th scope="col">{% trans 'Object' %}</th>
              <th scope="col">{% trans 'Date/time' %}</th>
              <th scope="col">{% trans 'Comment' %}</th>
              <th scope="col">{% trans 'Changed by' %}</th>
            </tr>
          </thead>
          <tbody>
            {% for action in action_list %}
              <tr>
                <td><a href="{{ action.revert_url }}">{{ action.history_object }}</a></td>
                <td>{{ action.history_date }}</td>
                <td>{{ action.get_history_type_display }}</td>
                <td>
                  {% if action.history_user %}
                    <a href="{% url admin_user_view action.history_user_id %}">{{ action.history_user }}</a>
                  {% else %}
                    None
                  {% endif %}
                </td>
              </tr>
            {% endfor %}
          </tbody>
        </table>
      {% else %}
        <p>{% trans "This object doesn't have a change history." %}</p>
      {% endif %}
    </div>
  </div>
{% endblock %}

