{# nautobot_app_vpn/templates/nautobot_app_vpn/ipsectunnel_edit.html #} {% extends 'generic/object_edit.html' %} {% load form_helpers %} {% load static %} {# Keep this load tag #} {% block form %} {# Render the main IPSec Tunnel form #}
IPSec Tunnel
{% render_form form %}
{# Render the Proxy ID formset if it exists #} {% if formset %}
Proxy IDs
{{ formset.management_form }} {# Required hidden fields for formset management #}
{# Added table-responsive #} {# Added thead-light for better styling #} {# Render headers for each field in the Proxy ID form #} {# This loop will now include the "Delete?" header automatically #} {% for field in formset.empty_form.visible_fields %} {% endfor %} {# Removed explicit Delete header - form.DELETE label should create it #} {# Loop through existing forms in the formset #} {% for form in formset %} {{ form.id }} {# Render hidden ID field if editing existing items #} {# This loop will render all fields, including the DELETE checkbox #} {% for field in form.visible_fields %} {# Use render_field #} {% endfor %} {# Render hidden fields specific to this form #} {% for field in form.hidden_fields %} {% if field.name != 'id' and field.name != 'DELETE' %} {{ field }} {% endif %} {% endfor %} {% endfor %}
{{ field.label }}
{% render_field field %}
{# Button to add new forms dynamically #}
{# End formset-container #} {# Hidden template for new forms used by JavaScript #} {# This structure is expected by standard Django formset JS helpers #} {# but we'll use it with our custom script #}
{# End panel-body #}
{# End panel #} {# Removed the attempt to load Nautobot's default formset.js #} {# #} {# Using custom Add Row script - UNCOMMENTED #} {% endif %} {# End if formset #} {% endblock form %}