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

{% block extrahead %}
  {{ block.super }}
  {{ media }}
  <script src="{% static 'admin/js/cancel.js' %}" async></script>
{% endblock %}

{% block extrastyle %}
  {{ block.super }}
  <link rel="stylesheet" type="text/css" href="{% static "elegant/css/forms.css" %}">
  <link rel="stylesheet" type="text/css" href="{% static "elegant/confirm/css/confirmation.css" %}">
{% endblock %}

{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }}
  change-confirmation{% endblock %}

{% 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 }}</a>
    &rsaquo; {% trans 'Confirm Action' %}
  </div>
{% endblock %}

{% block content %}
  {% if has_perm %}
    <form method="post">{% csrf_token %}
      {% for obj in queryset %}
        <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}">
      {% endfor %}
      <input type="hidden" name="action" value="{{ action }}">
      <div class="alert alert-block alert-info">
        <p>{% trans 'Are you sure you want to perform action' %} {{ action_display_name }} {% trans 'on the following' %} {{ opts.verbose_name_plural|capfirst }}?</p>
        <ul>
          {% for obj in affected_objects %}
            <li>{{ obj }}</li>
          {% endfor %}
        </ul>
        <br>
        <div class="submit-row">
          <input type="submit" value="{% trans 'Yes, I’m sure' %}" name="_confirm_action" class="btn btn-primary"/>
          <a href="{% url opts|admin_urlname:'changelist' %}" class="btn">{% trans "No, go back" %}</a>
        </div>
      </div>
    </form>
  {% else %}
    <div class="alert alert-block alert-error">
      <p>{% trans "You don't have permissions to perform action" %} {{ action_display_name }} {% trans 'on' %} {{ opts.verbose_name_plural|capfirst }}</p>
      <br/>
      <div class="submit-row">
        <p class="deletelink-box">
          <a href="{% url opts|admin_urlname:'changelist' %}" class="btn">{% trans "Go back" %}</a>
        </p>
      </div>
    </div>
  {% endif %}
{% endblock %}
