{% extends "base.html" %} {#- What a delete would take with it, counted before anything is written. A confirmation that only says "this cannot be undone" asks a question nobody can answer. The one people actually have is what happens to the rows underneath, and that is the difference between a confirmation and a trap. -#} {% macro related_list(groups) %}
{% endmacro %} {% block content %}{{ _("This cannot be undone.") }}
{{ _("Delete {name}?", name=label) }}
{% set protected = related | selectattr("effect", "equalto", "protect") | list %} {% set cascaded = related | selectattr("effect", "equalto", "delete") | list %} {% set cleared = related | selectattr("effect", "equalto", "clear") | list %} {% if protected %} {# The database would refuse this, so the button is not offered. Failing here with a sentence beats failing inside the transaction with a constraint violation nobody can act on. #}{{ _("Remove or reassign these first, then delete this record.") }}
{{ related_list(protected) }}