{% 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>
    {% if object.action == 'Deleted' %}
      <b>{% trans 'Object was deleted in this change, if you revert this change, object will be created again' %}</b>
    {% elif object.action == 'Added' %}
      <b>{% trans 'Object was added in this change, if you revert this change, object will be deleted' %}</b>
    {% endif %}
    {% for data in changed_data %}
      <p>{{ data.field }} = {{ data.values.old }}</p>
    {% endfor %}
  </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_change_change' object.pk %}" class="button cancel-link">{% trans "No, take me back" %}</a>
    </div>
  </form>
{% endblock %}