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

{% block content %}
{% if perms_lacking or protected %}
    {% if perms_lacking %}
        <p>{% blocktrans with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}</p>
        <ul>
        {% for obj in perms_lacking %}
            <li>{{ obj }}</li>
        {% endfor %}
        </ul>
    {% endif %}
    {% if protected %}
        <p>{% blocktrans with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktrans %}</p>
        <ul>
        {% for obj in protected %}
            <li>{{ obj }}</li>
        {% endfor %}
        </ul>
    {% endif %}
{% else %}
    <p>{% blocktrans with escaped_object=object %}Are you sure you want to delete the <strong>{{ object_name }} "{{ escaped_object }}"</strong>?{% endblocktrans %}</p>

    <div class="row">
    <p class="span9 alert alert-danger">{{ deleted_objects|length }} additional objects (e.g. user replies and answers, records of observations made) will be deleted from the database


        <button type="button" class="btn btn-mini" data-toggle="collapse" data-target="#demo">
          Show/hide details
        </button>
    </p>
</div>

    <div id="demo" class="collapse">
        <ul>
            {{deleted_objects|unordered_list}}
        </ul>
    </div>


    <form action="" method="post">{% csrf_token %}
    <div>
    <input type="hidden" name="post" value="yes" />
    <input type="submit" class="btn-danger" value="Delete {{ deleted_objects|length }} objects now" />
    </div>
    </form>
{% endif %}
{% endblock %}
