From 9316f48a20f2ff2ceaa51c0e9d8eb99b413c5be1 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 7 May 2024 10:27:20 -0400 Subject: [PATCH] Fixes #15982: Restore the "assign IP" tab --- netbox/ipam/views.py | 1 + .../ipam/inc/ipaddress_edit_header.html | 33 ++++------- netbox/templates/ipam/ipaddress_assign.html | 56 +++++++++---------- netbox/templates/ipam/ipaddress_edit.html | 5 ++ 4 files changed, 44 insertions(+), 51 deletions(-) create mode 100644 netbox/templates/ipam/ipaddress_edit.html diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 24d82d186..044474ec4 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -781,6 +781,7 @@ class IPAddressView(generic.ObjectView): class IPAddressEditView(generic.ObjectEditView): queryset = IPAddress.objects.all() form = forms.IPAddressForm + template_name = 'ipam/ipaddress_edit.html' def alter_object(self, obj, request, url_args, url_kwargs): diff --git a/netbox/templates/ipam/inc/ipaddress_edit_header.html b/netbox/templates/ipam/inc/ipaddress_edit_header.html index a635fbd8b..c7fbffee7 100644 --- a/netbox/templates/ipam/inc/ipaddress_edit_header.html +++ b/netbox/templates/ipam/inc/ipaddress_edit_header.html @@ -3,30 +3,21 @@ diff --git a/netbox/templates/ipam/ipaddress_assign.html b/netbox/templates/ipam/ipaddress_assign.html index 4ddd19941..3001bffc7 100644 --- a/netbox/templates/ipam/ipaddress_assign.html +++ b/netbox/templates/ipam/ipaddress_assign.html @@ -12,37 +12,33 @@ {% endblock %} {% block form %} -
- {% csrf_token %} - {% for field in form.hidden_fields %} - {{ field }} - {% endfor %} -
-
-
-
{% trans "Select IP Address" %}
- {% render_field form.vrf_id %} - {% render_field form.q %} -
-
+ + {% csrf_token %} + {% for field in form.hidden_fields %} + {{ field }} + {% endfor %} +
+
+
{% trans "Select IP Address" %}
+
+ {% render_field form.vrf_id %} + {% render_field form.q %} +
+
+ {% trans "Cancel" %} + +
+ + {% if table %} +
+
+

{% trans "Search Results" %}

+
+ {% render_table table 'inc/table.html' %}
-
-
- {% trans "Cancel" %} - -
-
- - {% if table %} -
-
-

{% trans "Search Results" %}

-
- {% render_table table 'inc/table.html' %} -
-
-
- {% endif %} +
+
+ {% endif %} {% endblock form %} {% block buttons %} diff --git a/netbox/templates/ipam/ipaddress_edit.html b/netbox/templates/ipam/ipaddress_edit.html new file mode 100644 index 000000000..48acde334 --- /dev/null +++ b/netbox/templates/ipam/ipaddress_edit.html @@ -0,0 +1,5 @@ +{% extends 'generic/object_edit.html' %} + +{% block tabs %} + {% include 'ipam/inc/ipaddress_edit_header.html' with active_tab='add' %} +{% endblock %}