{% extends request.is_ajax|yesno:"arctic/base_dialog.html,arctic/base.html" %}


{% load i18n arctic_tags staticfiles %}


{% block body_class %}
    {{ block.super }}
    template-delete
{% endblock %}


{% block content %}
    <div>
        {% if can_delete %}
            <form class="alert alert-warning text-center" action="" method="post">
                <fieldset type="post">
                    {% csrf_token %}

                    {% block confirm_message %}
                        <h5>Are you sure you want to delete "{{ object }}"?</h5>
                        <p>This cannot be undone</p>
                    {% endblock %}

                    <div class="button-group text-center">
                        {# Javascript cause forms, get filled values back #}
                        <a href="#" onclick="window.history.go(-1); return false;" class="btn btn-secondary">Cancel</a>
                        <input class="btn btn-primary" type="submit" value="Delete" />
                    </div>
                </fieldset>
            </form>
        {% else %}
            <section class="alert alert-warning">
                <header>
                    <h5>{{ collector_message }}</h5>
                </header>

                <ul class="tags warning">
                    {% for obj in protected_objects %}
                        <li>{{ obj }}</li>
                    {% endfor %}
                </ul>

                {# Javascript cause forms, get filled values back #}
                <a href="#" onclick="history.go(-1)" class="btn btn-secondary">Back</a>

            </section>
        {% endif %}
    </div>
{% endblock %}
