{% extends "admin/delete_confirmation.html" %}
{% load i18n %}
{% block extrastyle %}
    {{ block.super }}
    <link rel="stylesheet" href="{{MEDIA_URL}}scaffold/styles/scaffold-admin.css" type="text/css" media="screen"/>
    <style type="text/css" media="screen">
    .errornote {
        margin-bottom: 10px; 
        width: 330px;
    }
    </style>    
{%endblock%}
{% block breadcrumbs %}
<div class="breadcrumbs">
    <a href="{%url admin:index%}">{% trans "Home" %}</a> &rsaquo; 
    <a href="{{app_index_url}}">{{app_label|capfirst}}</a> &rsaquo;      
    <a href="{{changelist_url}}">{{model_label_plural|capfirst}}</a> &rsaquo;
    <a href="{{changelist_url}}{{obj.pk}}/">{{obj.title}}</a> &rsaquo;
    {% trans 'Delete'%}</em>
</div>
{% endblock %}
{% block content %}
<h2>Are you sure?</h2>
<p>Are you sure you want to delete the {{model_label}} <strong>{{obj.title}}</strong> permanently?</p>
{%if not obj.is_leaf%}
{%with obj.get_descendants as descendants%} 
<div class="errornote">
    <p>
        <strong>Warning!</strong> This {{model_label}} contains {{descendants|length}} other 
        sub-{%ifequal descendants|length 1%}{{model_label}}{%else%}{{model_label_plural}}{%endifequal%}:
    </p>
    <ul>
    {%for subobj in descendants%}
        <li>{{subobj.title}}</li>
    {%endfor%}
    </ul>
    <p>
        If you delete the {{model_label}} "{{obj.title}}", {{descendants|length|pluralize:"this,these"}} 
        {%ifequal descendants|length 1%}{{model_label}}{%else%}{{model_label_plural}}{%endifequal%} will be 
        deleted as well!
    </p>
</div>
{%endwith%}
{%endif%}
<form action="" method="POST">
{% csrf_token %}
<input type="submit" value="Yes, I'm sure" />
</form>
{% endblock %}