{% spaceless %}
<div class="service-module delete-confirmation">
    <div class="service-module-in">
        <div class="cnt">
            {% if perms_lacking %}
                <p>{% blocktrans with object as escaped_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>
            {% else %}
                <p>{% blocktrans with object as escaped_object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktrans %}</p>
                <ul class="js-hashadr-container">{{ deleted_objects|unordered_list|removetags:"a" }}</ul>
            {% endif %}
            <div class="submit-row">
                <form id="id-object-delete-form" action="delete/" class="js-form js-dyn-adr" method="post">
                    {% csrf_token %}
                    <a class="icn btn cancel js-simpleload" href="service-container::::delete/">{% trans "Cancel" %}</a>
                    {% if not perms_lacking %}
                        <input type="hidden" name="post" value="yes" />
                        <a class="icn btn ok def js-submit">{% trans "Yes, I'm sure" %}!</a>
                    {% endif %}

                    <div class="js-form-metadata">
                        <input type="hidden" name="success" />
                        <input type="hidden" name="error" />
                    </div>

                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    NewmanLib.register_post_submit_callback_once(
        function() {
            Kobayashi.unload_content('service-container');
        }
    );
    $('#id-object-delete-form .js-form-metadata input[name="error"]').data(
        'callback',
        batch_delete_confirm_error
    );
    $('#id-object-delete-form .js-form-metadata input[name="success"]').data(
        'callback',
        batch_delete_confirm_complete
    );
</script>
{% endspaceless %}
