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

{% block breadcrumbs %}
  <div class="breadcrumbs">
    <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
    &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
    &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
    &rsaquo; <a
          href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
    &rsaquo; {% trans 'Revert' %}
  </div>
{% endblock %}

{% block content %}
  <p>{% blocktrans with escaped_object=object %}Are you sure you want to revert the {{ object_name }}?{% endblocktrans %}</p>
  <div>
    <b>{% trans 'Revision contains many of changes, take a look very attentively at all changes' %}<br>
      {% trans 'Atantion! Only' %} {{ limit }} {% trans 'from' %} {{ changes_count }}
      {% trans 'showed in this table. But reverting will be in all changes. All changes you can see in Changes admin' %}
    </b>
    <table>
      <tr>
        <td>{% trans 'Change' %}</td>
        <td>{% trans 'Action' %}</td>
        <td>{% trans 'ContentType' %}</td>
        <td>{% trans 'Object_id' %}</td>
        <td>{% trans 'Changes of object' %}</td>
      </tr>
        {% for change in changes %}
          <tr>
            <td>{{ change }}</td>
            <td>{{ change.get_action_display }}</td>
            <td>{{ change.content_type }}</td>
            <td>{{ change.object_id }}</td>
            <td>
              {% for data in change.display_changed_data %}
                <p>{{ data.field }} - ({{ data.values.old }} -> {{ data.values.new }})</p>
              {% endfor %}
            </td>
          </tr>
        {% endfor %}
    </table>

  </div>


  <form method="post">{% csrf_token %}
    <div>
      <input type="hidden" name="post" value="yes"/>
      <input type="submit" value="{% trans "Yes, I'm sure" %}"/>
      <a href="{% url 'admin:models_logging_revision_change' object.pk %}" class="button cancel-link">{% trans "No, take me back" %}</a>
    </div>
  </form>
{% endblock %}