Back to Netbox

Delete Form

netbox/templates/htmx/delete_form.html

4.6.21.1 KB
Original Source

{% load form_helpers %} {% load i18n %}

{# Render hidden fields #} {% csrf_token %} {% for field in form.hidden_fields %} {{ field }} {% endfor %}

{% trans "Confirm Deletion" %}

{% blocktrans trimmed %} Are you sure you want to delete {{ object_type }} {{ object }}? {% endblocktrans %}

{% if dependent_objects %}

{% trans "The following objects will be deleted as a result of this action." %}

{% for model, instances in dependent_objects.items %}

{% with object_count=instances|length %} {{ object_count }} {% if object_count == 1 %} {{ model|meta:"verbose_name" }} {% else %} {{ model|meta:"verbose_name_plural" }} {% endif %} {% endwith %}

{% for instance in instances %} {% with url=instance.get_absolute_url %} {{ instance }} {% endwith %} {% endfor %}

{% endfor %} {% endif %} {# Meta fields #} {% if form.changelog_message %} {% render_field form.changelog_message %} {% endif %}

{% if return_url %} {% trans "Cancel" %} {% else %} {% trans "Cancel" %} {% endif %} {% trans "Delete" %}