From 66619cdc2fed9d142bf5953ba7c1064d65ed7a3b Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 25 Aug 2021 15:03:19 -0400 Subject: [PATCH] Clean up object edit forms --- netbox/project-static/dist/netbox-dark.css | Bin 807486 -> 807419 bytes netbox/project-static/dist/netbox-light.css | Bin 502311 -> 502278 bytes netbox/project-static/dist/netbox-print.css | Bin 1658369 -> 1658176 bytes netbox/project-static/styles/netbox.scss | 5 +-- .../circuits/circuittermination_edit.html | 8 +++-- netbox/templates/dcim/device_edit.html | 32 +++++++++++------- netbox/templates/dcim/inc/cable_form.html | 7 ++-- netbox/templates/dcim/interface_edit.html | 18 ++++++---- netbox/templates/dcim/rack_edit.html | 26 +++++++++----- netbox/templates/dcim/site.html | 10 ++++++ netbox/templates/dcim/virtualchassis_add.html | 10 ++++-- .../templates/dcim/virtualchassis_edit.html | 8 +++-- netbox/templates/generic/object_edit.html | 15 +++++--- netbox/templates/inc/filter_list.html | 2 +- netbox/templates/ipam/ipaddress_bulk_add.html | 21 ++++++++---- netbox/templates/ipam/ipaddress_edit.html | 22 ++++++++---- netbox/templates/ipam/service_edit.html | 4 ++- netbox/templates/ipam/vlan_edit.html | 16 ++++++--- .../virtualization/vminterface_edit.html | 10 ++++-- 19 files changed, 145 insertions(+), 69 deletions(-) diff --git a/netbox/project-static/dist/netbox-dark.css b/netbox/project-static/dist/netbox-dark.css index 5de631e37b39dd22db59dcd323a9ad7a74684e10..1a55a00963955984b88ce91c713116eaf15519d8 100644 GIT binary patch delta 86 zcmV-c0IC1Jq%r%WF@S^tgaU*Egam{Iga(8Mgb0KQgbK6^mgEvF7M2#)7Pc1l7LFFq7OpMa)1FLz(4{kd0Sgby_M1<*{~Cgs zI%%1yIVrm7Mfs%#R(bg)8dhnUMa3n$`DwZ(l?ADq)wzj9>6v-DCHVzb#*-H&sZAFb N=i%G_M2tt=8UR_SDKG#4 diff --git a/netbox/project-static/dist/netbox-light.css b/netbox/project-static/dist/netbox-light.css index 330e2efc95f4fa0cedadf387d30083ac4f4c4bc9..ed5941e35cf382b099ee691a29afe7816856958c 100644 GIT binary patch delta 55 zcmZ2}MXv3NTtf?E3sVbo3rh=Y3)>dBDegCTtf?E3sVbo3rh=Y3)>djEhopw}&;dZ_oe$f=3`P diff --git a/netbox/project-static/dist/netbox-print.css b/netbox/project-static/dist/netbox-print.css index c77db1bc8319ddd3196bbdd85fef188732c0288a..bc76dc0295244440e56ab9fa25c5cc664226b821 100644 GIT binary patch delta 129 zcmZpilX_rQYC{WS3sVbo3rh=Y3tJ0&3r7oQ3s(zw3r`Dg3ttO=i$IHDi%^Sji%5%T zi&%^J7Ks&wLTUMVCA#IQnduoNR(bhFxrsTG*OkdlPcN1bp3YY!Av@VXh;8~BAa6U6 cH!XEK?@bB5>DzBWBqr;dv2I^?Ln62o03{?WjsO4v delta 217 zcmX>wE46V>YC{WS3sVbo3rh=Y3tJ0&3r7oQ3s(zw3r`Dg3ttO=i$IHDi%^Sji%5%T zi&%^J7Ks&wlh>EYPOmDK5S}hmEFnADK!|O6!#W9;>Ab}f?%N}aB;r!}Q!>l+(lS$X zQgqXc@=FV*>#FmZgB5Y3i5gB05M-b3P%OcsgCt{>mtUe`m6lmlT%wzwrdv{3kg8do qn^=^dnWtNlUtncCT~LKle7esK3BKvyu0z}~S>KFx``hah!KDE2dP)=k diff --git a/netbox/project-static/styles/netbox.scss b/netbox/project-static/styles/netbox.scss index e19e8f964..de568d22d 100644 --- a/netbox/project-static/styles/netbox.scss +++ b/netbox/project-static/styles/netbox.scss @@ -243,6 +243,7 @@ table { &.attr-table { th { + font-weight: normal; width: 25%; } } @@ -723,10 +724,6 @@ div.paginator > form > div.input-group { width: fit-content; } -div.field-group:not(:first-of-type) { - margin-top: $spacer * 3; -} - label.required { font-weight: $font-weight-bold; diff --git a/netbox/templates/circuits/circuittermination_edit.html b/netbox/templates/circuits/circuittermination_edit.html index edafc94a8..76ef4a5d2 100644 --- a/netbox/templates/circuits/circuittermination_edit.html +++ b/netbox/templates/circuits/circuittermination_edit.html @@ -5,7 +5,7 @@ {% block title %}{{ obj.circuit.provider }} {{ obj.circuit }} - Side {{ form.term_side.value }}{% endblock %} {% block form %} -
+
Circuit Termination
@@ -41,7 +41,7 @@
-
+
{% render_field form.region %} {% render_field form.site_group %} @@ -53,7 +53,9 @@
{% endwith %}
-
+
+ +
Termination Details
diff --git a/netbox/templates/dcim/device_edit.html b/netbox/templates/dcim/device_edit.html index c900b10dd..ab754a74f 100644 --- a/netbox/templates/dcim/device_edit.html +++ b/netbox/templates/dcim/device_edit.html @@ -4,7 +4,7 @@ {% block form %} {% render_errors form %} -
+
Device
@@ -12,8 +12,9 @@ {% render_field form.device_role %} {% render_field form.tags %}
+
-
+
Hardware
@@ -22,8 +23,9 @@ {% render_field form.serial %} {% render_field form.asset_tag %}
+
-
+
Location
@@ -56,8 +58,9 @@ {% render_field form.position %} {% endif %}
+
-
+
Management
@@ -68,38 +71,43 @@ {% render_field form.primary_ip6 %} {% endif %}
+
-
+
Virtualization
{% render_field form.cluster_group %} {% render_field form.cluster %}
+
-
+
Tenancy
{% render_field form.tenant_group %} {% render_field form.tenant %}
+
-{% if form.custom_fields %} -
+ {% if form.custom_fields %} +
Custom Fields
{% render_custom_fields form %} -
+
+
+ {% endif %} -{% endif %} -
+
Local Config Context Data
{% render_field form.local_context_data %}
+
-
+
{% render_field form.comments label='Comments' %}
diff --git a/netbox/templates/dcim/inc/cable_form.html b/netbox/templates/dcim/inc/cable_form.html index 89d4c5130..f1baeb756 100644 --- a/netbox/templates/dcim/inc/cable_form.html +++ b/netbox/templates/dcim/inc/cable_form.html @@ -16,8 +16,11 @@
{% render_field form.tags %} {% if form.custom_fields %} +
-

Custom Fields

- {% render_custom_fields form %} +
+
Custom Fields
+
+ {% render_custom_fields form %}
{% endif %} diff --git a/netbox/templates/dcim/interface_edit.html b/netbox/templates/dcim/interface_edit.html index 8b8845e8c..64cd8407e 100644 --- a/netbox/templates/dcim/interface_edit.html +++ b/netbox/templates/dcim/interface_edit.html @@ -2,7 +2,7 @@ {% load form_helpers %} {% block form %} -
+
Interface
@@ -27,7 +27,9 @@ {% render_field form.mgmt_only %} {% render_field form.mark_connected %}
-
+
+ +
802.1Q Switching
@@ -36,13 +38,15 @@ {% render_field form.untagged_vlan %} {% render_field form.tagged_vlans %}
+ {% if form.custom_fields %} -
-
-
Custom Fields
-
- {% render_custom_fields form %} +
+
+
+
Custom Fields
+ {% render_custom_fields form %} +
{% endif %} {% endblock %} diff --git a/netbox/templates/dcim/rack_edit.html b/netbox/templates/dcim/rack_edit.html index 09b1586e2..64e366ea7 100644 --- a/netbox/templates/dcim/rack_edit.html +++ b/netbox/templates/dcim/rack_edit.html @@ -2,7 +2,7 @@ {% load form_helpers %} {% block form %} -
+
Rack
@@ -15,7 +15,9 @@ {% render_field form.role %} {% render_field form.tags %}
-
+
+ +
Inventory Control
@@ -23,14 +25,18 @@ {% render_field form.serial %} {% render_field form.asset_tag %}
-
+
+ +
Tenancy
{% render_field form.tenant_group %} {% render_field form.tenant %}
-
+
+ +
Dimensions
@@ -54,15 +60,19 @@
{% render_field form.desc_units %}
+
+ {% if form.custom_fields %} -
+
Custom Fields
- {% render_custom_fields form %} -
+ {% render_custom_fields form %} +
+
{% endif %} -
+ +
{% render_field form.comments label='Comments' %}
{% endblock %} diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index 1e50e7ba6..17628cbde 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -209,7 +209,14 @@ Locations
+ {% if locations %} + + + + + + {% for location in locations %} {% endfor %}
LocationRacksDevices
@@ -230,6 +237,9 @@
+ {% else %} + None + {% endif %}
diff --git a/netbox/templates/dcim/virtualchassis_add.html b/netbox/templates/dcim/virtualchassis_add.html index 1a5bd85c2..1ff0cd8bd 100644 --- a/netbox/templates/dcim/virtualchassis_add.html +++ b/netbox/templates/dcim/virtualchassis_add.html @@ -2,7 +2,7 @@ {% load form_helpers %} {% block form %} -
+
Virtual Chassis
@@ -10,7 +10,9 @@ {% render_field form.domain %} {% render_field form.tags %}
-
+
+ +
Member Devices
@@ -21,8 +23,10 @@ {% render_field form.members %} {% render_field form.initial_position %}
+ {% if form.custom_fields %} -
+
+
Custom Fields
diff --git a/netbox/templates/dcim/virtualchassis_edit.html b/netbox/templates/dcim/virtualchassis_edit.html index e726b7687..c994f05dc 100644 --- a/netbox/templates/dcim/virtualchassis_edit.html +++ b/netbox/templates/dcim/virtualchassis_edit.html @@ -11,7 +11,7 @@ {% csrf_token %} {{ pk_form.pk }} {{ formset.management_form }} -
+
Virtual Chassis
@@ -20,14 +20,18 @@ {% render_field vc_form.master %} {% render_field vc_form.tags %}
+
+ {% if vc_form.custom_fields %} -
+
Custom Fields
{% render_custom_fields vc_form %}
+
{% endif %} +
Members
diff --git a/netbox/templates/generic/object_edit.html b/netbox/templates/generic/object_edit.html index 95657249d..7ee4c4f94 100644 --- a/netbox/templates/generic/object_edit.html +++ b/netbox/templates/generic/object_edit.html @@ -42,7 +42,7 @@ {# Render grouped fields according to Form #} {% for group, fields in form.Meta.fieldsets %} -
+
{{ group }}
@@ -50,11 +50,15 @@ {% render_field form|getfield:name %} {% endfor %}
+ {% if not forloop.last %} +
+ {% endif %} {% endfor %} {% if form.custom_fields %} -
-
+
+
+
Custom Fields
{% render_custom_fields form %} @@ -62,14 +66,15 @@ {% endif %} {% if form.comments %} -
+
+
{% render_field form.comments label='Comments' %}
{% endif %} {% else %} {# Render all fields in a single group #} -
+
{% block form_fields %}{% render_form form %}{% endblock %}
{% endif %} diff --git a/netbox/templates/inc/filter_list.html b/netbox/templates/inc/filter_list.html index cf1ec342e..1e73fedb2 100644 --- a/netbox/templates/inc/filter_list.html +++ b/netbox/templates/inc/filter_list.html @@ -48,7 +48,7 @@ Reset
diff --git a/netbox/templates/ipam/ipaddress_bulk_add.html b/netbox/templates/ipam/ipaddress_bulk_add.html index 84fe60dcf..af0b27e98 100644 --- a/netbox/templates/ipam/ipaddress_bulk_add.html +++ b/netbox/templates/ipam/ipaddress_bulk_add.html @@ -9,8 +9,10 @@ {% endblock %} {% block form %} -
-
IP Addresses
+
+
+
IP Addresses
+
{% render_field form.pattern %} {% render_field model_form.status %} {% render_field model_form.role %} @@ -18,14 +20,21 @@ {% render_field model_form.description %} {% render_field model_form.tags %}
-
-
Tenancy
+
+ +
+
+
Tenancy
+
{% render_field model_form.tenant_group %} {% render_field model_form.tenant %}
{% if model_form.custom_fields %} -
-
Custom Fields
+
+
+
+
Custom Fields
+
{% render_custom_fields model_form %}
{% endif %} diff --git a/netbox/templates/ipam/ipaddress_edit.html b/netbox/templates/ipam/ipaddress_edit.html index 1aa5d1d81..d12c12245 100644 --- a/netbox/templates/ipam/ipaddress_edit.html +++ b/netbox/templates/ipam/ipaddress_edit.html @@ -8,7 +8,7 @@ {% endblock tabs %} {% block form %} -
+
IP Address
@@ -20,14 +20,18 @@ {% render_field form.description %} {% render_field form.tags %}
-
+
+ +
Tenancy
{% render_field form.tenant_group %} {% render_field form.tenant %}
-
+
+ +
Interface Assignment
@@ -64,7 +68,7 @@
-
+
{% render_field form.device %} {% render_field form.interface %} @@ -77,7 +81,9 @@
{% endwith %}
-
+
+ +
NAT IP (Inside)
@@ -126,7 +132,7 @@
-
+
{% render_field form.nat_region %} {% render_field form.nat_site_group %} @@ -144,8 +150,10 @@ {% render_field form.nat_inside %}
+ {% if form.custom_fields %} -
+
+
Custom Fields
diff --git a/netbox/templates/ipam/service_edit.html b/netbox/templates/ipam/service_edit.html index 20c9df0d4..fe8ddf525 100644 --- a/netbox/templates/ipam/service_edit.html +++ b/netbox/templates/ipam/service_edit.html @@ -2,7 +2,7 @@ {% load form_helpers %} {% block form %} -
+
Service
@@ -41,7 +41,9 @@ {% render_field form.description %} {% render_field form.tags %}
+ {% if form.custom_fields %} +
Custom Fields
diff --git a/netbox/templates/ipam/vlan_edit.html b/netbox/templates/ipam/vlan_edit.html index f1f4ecc2d..776e0aa4a 100644 --- a/netbox/templates/ipam/vlan_edit.html +++ b/netbox/templates/ipam/vlan_edit.html @@ -4,7 +4,7 @@ {% load helpers %} {% block form %} -
+
VLAN
@@ -15,14 +15,18 @@ {% render_field form.description %} {% render_field form.tags %}
-
+
+ +
Tenancy
{% render_field form.tenant_group %} {% render_field form.tenant %}
-
+
+ +
Assignment
@@ -39,7 +43,7 @@
-
+
{% render_field form.scope_type %} {% render_field form.group %} @@ -52,8 +56,10 @@
{% endwith %}
+ {% if form.custom_fields %} -
+
+
Custom Fields
diff --git a/netbox/templates/virtualization/vminterface_edit.html b/netbox/templates/virtualization/vminterface_edit.html index 1ea417dbe..ad3c77e13 100644 --- a/netbox/templates/virtualization/vminterface_edit.html +++ b/netbox/templates/virtualization/vminterface_edit.html @@ -2,7 +2,7 @@ {% load form_helpers %} {% block form %} -
+
Interface
@@ -22,7 +22,9 @@ {% render_field form.description %} {% render_field form.tags %}
-
+
+ +
802.1Q Switching
@@ -31,8 +33,10 @@ {% render_field form.untagged_vlan %} {% render_field form.tagged_vlans %}
+ {% if form.custom_fields %} -
+
+
Custom Fields