diff --git a/django/contrib/admin/templates/admin/delete_confirmation.html b/django/contrib/admin/templates/admin/delete_confirmation.html index a3894f33b66..09e25e1f53a 100644 --- a/django/contrib/admin/templates/admin/delete_confirmation.html +++ b/django/contrib/admin/templates/admin/delete_confirmation.html @@ -21,16 +21,21 @@ {% block content %} {% if perms_lacking %} + {% block delete_forbidden %}

{% blocktranslate 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:{% endblocktranslate %}

- + + {% endblock %} {% elif protected %} + {% block delete_protected %}

{% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktranslate %}

- + + {% endblock %} {% else %} + {% block delete_confirm %}

{% blocktranslate 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:{% endblocktranslate %}

{% include "admin/includes/object_delete_summary.html" %}

{% translate "Objects" %}

- +
{% csrf_token %}
@@ -40,5 +45,6 @@ {% translate "No, take me back" %}
+ {% endblock %} {% endif %} -{% endblock %} +{% endblock content %} diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt index 68991da46db..d7e40f600bf 100644 --- a/docs/releases/4.2.txt +++ b/docs/releases/4.2.txt @@ -39,6 +39,10 @@ Minor features downloading fonts. Additionally, CSS variables are available to more easily override the default font families. +* The :source:`admin/delete_confirmation.html + ` template now + has some additional blocks and scripting hooks to ease customization. + :mod:`django.contrib.admindocs` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~