Simplified admin delete confirmation templates using {% elif %}.

Thanks jonash for the initial patch; refs #20133.
This commit is contained in:
areski 2014-08-13 15:24:24 +02:00 committed by Tim Graham
parent d38a00332e
commit 3687aa0093
2 changed files with 28 additions and 34 deletions

View File

@ -14,23 +14,20 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if perms_lacking or protected %} {% if perms_lacking %}
{% 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>
<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>
<ul> {% for obj in perms_lacking %}
{% for obj in perms_lacking %} <li>{{ obj }}</li>
<li>{{ obj }}</li> {% endfor %}
{% endfor %} </ul>
</ul> {% elif protected %}
{% endif %} <p>{% blocktrans with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktrans %}</p>
{% if protected %} <ul>
<p>{% blocktrans with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktrans %}</p> {% for obj in protected %}
<ul> <li>{{ obj }}</li>
{% for obj in protected %} {% endfor %}
<li>{{ obj }}</li> </ul>
{% endfor %}
</ul>
{% endif %}
{% else %} {% else %}
<p>{% blocktrans with escaped_object=object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktrans %}</p> <p>{% blocktrans with escaped_object=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>{{ deleted_objects|unordered_list }}</ul> <ul>{{ deleted_objects|unordered_list }}</ul>

View File

@ -13,23 +13,20 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if perms_lacking or protected %} {% if perms_lacking %}
{% if perms_lacking %} <p>{% blocktrans %}Deleting the selected {{ objects_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}</p>
<p>{% blocktrans %}Deleting the selected {{ objects_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktrans %}</p> <ul>
<ul> {% for obj in perms_lacking %}
{% for obj in perms_lacking %} <li>{{ obj }}</li>
<li>{{ obj }}</li> {% endfor %}
{% endfor %} </ul>
</ul> {% elif protected %}
{% endif %} <p>{% blocktrans %}Deleting the selected {{ objects_name }} would require deleting the following protected related objects:{% endblocktrans %}</p>
{% if protected %} <ul>
<p>{% blocktrans %}Deleting the selected {{ objects_name }} would require deleting the following protected related objects:{% endblocktrans %}</p> {% for obj in protected %}
<ul> <li>{{ obj }}</li>
{% for obj in protected %} {% endfor %}
<li>{{ obj }}</li> </ul>
{% endfor %}
</ul>
{% endif %}
{% else %} {% else %}
<p>{% blocktrans %}Are you sure you want to delete the selected {{ objects_name }}? All of the following objects and their related items will be deleted:{% endblocktrans %}</p> <p>{% blocktrans %}Are you sure you want to delete the selected {{ objects_name }}? All of the following objects and their related items will be deleted:{% endblocktrans %}</p>
{% for deletable_object in deletable_objects %} {% for deletable_object in deletable_objects %}