{% extends "form_view.html" %} {% load i18n %} {% block before_form %} {% if is_protected %} {# ===== Scenario 3: Object is PROTECT-blocked - no delete button ===== #} {% trans "This record cannot be deleted." %}

{% trans "It is referenced by the following records, which must be removed or updated first:" %}

{% else %} {# ===== Scenarios 1, 2, 4: Object is safe to delete ===== #} {% trans "You are about to" %} {% trans "permanently" %} {% trans "delete this record. This action cannot be undone." %} {% if related_objects %} {# ===== Scenario 2: Related-objects summary (opt-in) ===== #} {% trans "The following related records will also be permanently deleted:" %} {% for label, objs, overflow in related_objects %}

{{ label }}

{% if overflow %}

… and {{ overflow }} more

{% endif %} {% endfor %}
{% endif %} {% if require_confirmation %} {# ===== Scenario 4: Type-to-confirm input (opt-in) ===== #} {% if form.errors.confirmation %} {% endif %}

{% blocktrans with val=confirmation_value %}To confirm, type {{ val }} below:{% endblocktrans %}

{% endif %} {% endif %} {% endblock before_form %} {% block actions %} {% if not is_protected %} {% if require_confirmation %} {% else %} {% endif %} {% endif %} {% endblock actions %} {% block extra_js %} {% if require_confirmation %} {% endif %} {% endblock extra_js %}