From 0ef1bc8490dc2f6d6623a3b209406d57bc278efd Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 16 Aug 2022 09:49:51 -0400 Subject: [PATCH] Clean up bulk edit buttons --- .../templates/dcim/device/consoleports.html | 54 ++++++++++--------- .../dcim/device/consoleserverports.html | 54 ++++++++++--------- netbox/templates/dcim/device/devicebays.html | 44 +++++++-------- netbox/templates/dcim/device/frontports.html | 54 ++++++++++--------- netbox/templates/dcim/device/interfaces.html | 51 ++++++++++-------- netbox/templates/dcim/device/inventory.html | 44 +++++++-------- netbox/templates/dcim/device/modulebays.html | 44 +++++++-------- .../templates/dcim/device/poweroutlets.html | 54 ++++++++++--------- netbox/templates/dcim/device/powerports.html | 54 ++++++++++--------- netbox/templates/dcim/device/rearports.html | 54 ++++++++++--------- netbox/templates/dcim/device_list.html | 16 ++++-- .../virtualmachine/interfaces.html | 43 +++++++-------- 12 files changed, 311 insertions(+), 255 deletions(-) diff --git a/netbox/templates/dcim/device/consoleports.html b/netbox/templates/dcim/device/consoleports.html index afc306bd4..6f8b383c3 100644 --- a/netbox/templates/dcim/device/consoleports.html +++ b/netbox/templates/dcim/device/consoleports.html @@ -16,31 +16,37 @@
-
- {% if perms.dcim.change_consoleport %} - - - - {% endif %} - {% if perms.dcim.delete_consoleport %} - - {% endif %} -
- {% if perms.dcim.add_consoleport %} - +
+ {% if perms.dcim.change_consoleport %} +
+ + +
{% endif %} +
+ {% if perms.dcim.delete_consoleport %} + + {% endif %} + {% if perms.dcim.change_consoleport %} + + {% endif %} +
+
+ {% if perms.dcim.add_consoleport %} + + {% endif %}
{% endblock %} diff --git a/netbox/templates/dcim/device/consoleserverports.html b/netbox/templates/dcim/device/consoleserverports.html index 5f244cdc7..f246d4a82 100644 --- a/netbox/templates/dcim/device/consoleserverports.html +++ b/netbox/templates/dcim/device/consoleserverports.html @@ -16,31 +16,37 @@
-
- {% if perms.dcim.change_consoleserverport %} - - - - {% endif %} - {% if perms.dcim.delete_consoleserverport %} - - {% endif %} -
- {% if perms.dcim.add_consoleserverport %} - +
+ {% if perms.dcim.change_consoleserverport %} +
+ + +
{% endif %} +
+ {% if perms.dcim.delete_consoleserverport %} + + {% endif %} + {% if perms.dcim.change_consoleserverport %} + + {% endif %} +
+
+ {% if perms.dcim.add_consoleserverport %} + + {% endif %}
{% endblock %} diff --git a/netbox/templates/dcim/device/devicebays.html b/netbox/templates/dcim/device/devicebays.html index 5e33bdae0..d84408962 100644 --- a/netbox/templates/dcim/device/devicebays.html +++ b/netbox/templates/dcim/device/devicebays.html @@ -16,28 +16,30 @@
-
- {% if perms.dcim.change_devicebay %} - - - {% endif %} - {% if perms.dcim.delete_devicebay %} - - {% endif %} -
- {% if perms.dcim.add_devicebay %} - +
+ {% if perms.dcim.change_devicebay %} +
+ + +
{% endif %} + {% if perms.dcim.delete_devicebay %} + + {% endif %} +
+ {% if perms.dcim.add_devicebay %} + + {% endif %}
{% endblock %} diff --git a/netbox/templates/dcim/device/frontports.html b/netbox/templates/dcim/device/frontports.html index 0d0f9577c..513d02090 100644 --- a/netbox/templates/dcim/device/frontports.html +++ b/netbox/templates/dcim/device/frontports.html @@ -16,31 +16,37 @@
-
- {% if perms.dcim.change_frontport %} - - - - {% endif %} - {% if perms.dcim.delete_frontport %} - - {% endif %} -
- {% if perms.dcim.add_frontport %} - +
+ {% if perms.dcim.change_frontport %} +
+ + +
{% endif %} +
+ {% if perms.dcim.delete_frontport %} + + {% endif %} + {% if perms.dcim.change_frontport %} + + {% endif %} +
+
+ {% if perms.dcim.add_frontport %} + + {% endif %}
{% endblock %} diff --git a/netbox/templates/dcim/device/interfaces.html b/netbox/templates/dcim/device/interfaces.html index 94e38dbf3..2019d9135 100644 --- a/netbox/templates/dcim/device/interfaces.html +++ b/netbox/templates/dcim/device/interfaces.html @@ -9,7 +9,6 @@
{% csrf_token %} -
{% include 'htmx/table.html' %} @@ -19,29 +18,35 @@
{% if perms.dcim.change_interface %} - - - - {% endif %} - {% if perms.dcim.delete_interface %} - +
+ + +
{% endif %} +
+ {% if perms.dcim.delete_interface %} + + {% endif %} + {% if perms.dcim.change_interface %} + + {% endif %} +
{% if perms.dcim.add_interface %}
diff --git a/netbox/templates/dcim/device/inventory.html b/netbox/templates/dcim/device/inventory.html index 18a0712f3..8b74acaae 100644 --- a/netbox/templates/dcim/device/inventory.html +++ b/netbox/templates/dcim/device/inventory.html @@ -16,28 +16,30 @@
-
- {% if perms.dcim.change_inventoryitem %} - - - {% endif %} - {% if perms.dcim.delete_inventoryitem %} - - {% endif %} -
- {% if perms.dcim.add_inventoryitem %} - +
+ {% if perms.dcim.change_inventoryitem %} +
+ + +
{% endif %} + {% if perms.dcim.delete_inventoryitem %} + + {% endif %} +
+ {% if perms.dcim.add_inventoryitem %} + + {% endif %}
{% endblock %} diff --git a/netbox/templates/dcim/device/modulebays.html b/netbox/templates/dcim/device/modulebays.html index fc1c9a60d..67b9d88d4 100644 --- a/netbox/templates/dcim/device/modulebays.html +++ b/netbox/templates/dcim/device/modulebays.html @@ -16,28 +16,30 @@
-
- {% if perms.dcim.change_modulebay %} - - - {% endif %} - {% if perms.dcim.delete_modulebay %} - - {% endif %} -
- {% if perms.dcim.add_modulebay %} - +
+ {% if perms.dcim.change_modulebay %} +
+ + +
{% endif %} + {% if perms.dcim.delete_modulebay %} + + {% endif %} +
+ {% if perms.dcim.add_modulebay %} + + {% endif %}
{% table_config_form table %} diff --git a/netbox/templates/dcim/device/poweroutlets.html b/netbox/templates/dcim/device/poweroutlets.html index d312fbbd0..61c2b61f4 100644 --- a/netbox/templates/dcim/device/poweroutlets.html +++ b/netbox/templates/dcim/device/poweroutlets.html @@ -16,31 +16,37 @@
-
- {% if perms.dcim.change_powerport %} - - - - {% endif %} - {% if perms.dcim.delete_poweroutlet %} - - {% endif %} -
- {% if perms.dcim.add_poweroutlet %} - +
+ {% if perms.dcim.change_powerport %} +
+ + +
{% endif %} +
+ {% if perms.dcim.delete_poweroutlet %} + + {% endif %} + {% if perms.dcim.change_powerport %} + + {% endif %} +
+
+ {% if perms.dcim.add_poweroutlet %} + + {% endif %}
{% endblock %} diff --git a/netbox/templates/dcim/device/powerports.html b/netbox/templates/dcim/device/powerports.html index cf71e81ba..cd8597e63 100644 --- a/netbox/templates/dcim/device/powerports.html +++ b/netbox/templates/dcim/device/powerports.html @@ -16,31 +16,37 @@
-
- {% if perms.dcim.change_powerport %} - - - - {% endif %} - {% if perms.dcim.delete_powerport %} - - {% endif %} -
- {% if perms.dcim.add_powerport %} - +
+ {% if perms.dcim.change_powerport %} +
+ + +
{% endif %} +
+ {% if perms.dcim.delete_powerport %} + + {% endif %} + {% if perms.dcim.change_powerport %} + + {% endif %} +
+
+ {% if perms.dcim.add_powerport %} + + {% endif %}
{% endblock %} diff --git a/netbox/templates/dcim/device/rearports.html b/netbox/templates/dcim/device/rearports.html index 73341990f..b370de189 100644 --- a/netbox/templates/dcim/device/rearports.html +++ b/netbox/templates/dcim/device/rearports.html @@ -16,31 +16,37 @@
-
- {% if perms.dcim.change_rearport %} - - - - {% endif %} - {% if perms.dcim.delete_rearport %} - - {% endif %} -
- {% if perms.dcim.add_rearport %} - +
+ {% if perms.dcim.change_rearport %} +
+ + +
{% endif %} +
+ {% if perms.dcim.delete_rearport %} + + {% endif %} + {% if perms.dcim.change_rearport %} + + {% endif %} +
+
+ {% if perms.dcim.add_rearport %} + + {% endif %}
{% endblock %} diff --git a/netbox/templates/dcim/device_list.html b/netbox/templates/dcim/device_list.html index a576a1f9e..50af50525 100644 --- a/netbox/templates/dcim/device_list.html +++ b/netbox/templates/dcim/device_list.html @@ -1,10 +1,8 @@ {% extends 'generic/object_list.html' %} +{% load buttons %} {% block bulk_buttons %} {% if perms.dcim.change_device %} - {% endif %} - {{ block.super }} + {% if 'bulk_edit' in actions %} +
+ {% bulk_edit_button model query_params=request.GET %} + +
+ {% endif %} + {% if 'bulk_delete' in actions %} + {% bulk_delete_button model query_params=request.GET %} + {% endif %} {% endblock %} diff --git a/netbox/templates/virtualization/virtualmachine/interfaces.html b/netbox/templates/virtualization/virtualmachine/interfaces.html index e3ffb84d4..eff98cdd6 100644 --- a/netbox/templates/virtualization/virtualmachine/interfaces.html +++ b/netbox/templates/virtualization/virtualmachine/interfaces.html @@ -15,27 +15,28 @@
- {% if perms.virtualization.change_vminterface %} - - - {% endif %} - {% if perms.virtualization.delete_vminterface %} - - {% endif %} - {% if perms.virtualization.add_vminterface %} - - {% endif %} -
+ {% if perms.virtualization.change_vminterface %} +
+ + +
+ {% endif %} + {% if perms.virtualization.delete_vminterface %} + + {% endif %} + {% if perms.virtualization.add_vminterface %} + + {% endif %}
{% endblock content %}