From 314c41f47f8eba4df84688a478452b5178b091d7 Mon Sep 17 00:00:00 2001 From: kkthxbye <> Date: Thu, 28 Apr 2022 07:47:04 +0200 Subject: [PATCH] Prevent searching when pressing enter in Quick Search --- .../templates/dcim/device/consoleports.html | 3 +- .../dcim/device/consoleserverports.html | 3 +- netbox/templates/dcim/device/devicebays.html | 3 +- netbox/templates/dcim/device/frontports.html | 3 +- netbox/templates/dcim/device/interfaces.html | 74 ++++++++++--------- netbox/templates/dcim/device/inventory.html | 3 +- netbox/templates/dcim/device/modulebays.html | 3 +- .../templates/dcim/device/poweroutlets.html | 3 +- netbox/templates/dcim/device/powerports.html | 3 +- netbox/templates/dcim/device/rearports.html | 3 +- netbox/templates/ipam/aggregate/prefixes.html | 3 +- .../templates/ipam/iprange/ip_addresses.html | 3 +- .../templates/ipam/prefix/ip_addresses.html | 3 +- netbox/templates/ipam/prefix/ip_ranges.html | 3 +- netbox/templates/ipam/prefix/prefixes.html | 3 +- netbox/templates/ipam/vlan/interfaces.html | 3 +- netbox/templates/ipam/vlan/vminterfaces.html | 3 +- .../virtualization/cluster/devices.html | 3 +- .../cluster/virtual_machines.html | 3 +- .../virtualmachine/interfaces.html | 3 +- 20 files changed, 76 insertions(+), 55 deletions(-) diff --git a/netbox/templates/dcim/device/consoleports.html b/netbox/templates/dcim/device/consoleports.html index f96854ca84..afc306bd4e 100644 --- a/netbox/templates/dcim/device/consoleports.html +++ b/netbox/templates/dcim/device/consoleports.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsolePortTable_config" %} +
{% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsolePortTable_config" %}
diff --git a/netbox/templates/dcim/device/consoleserverports.html b/netbox/templates/dcim/device/consoleserverports.html index eb27b4ab0f..5f244cdc7c 100644 --- a/netbox/templates/dcim/device/consoleserverports.html +++ b/netbox/templates/dcim/device/consoleserverports.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsoleServerPortTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceConsoleServerPortTable_config" %}
diff --git a/netbox/templates/dcim/device/devicebays.html b/netbox/templates/dcim/device/devicebays.html index 672cb192a8..5e33bdae03 100644 --- a/netbox/templates/dcim/device/devicebays.html +++ b/netbox/templates/dcim/device/devicebays.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceDeviceBayTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceDeviceBayTable_config" %}
diff --git a/netbox/templates/dcim/device/frontports.html b/netbox/templates/dcim/device/frontports.html index 816d193dec..0d0f9577ca 100644 --- a/netbox/templates/dcim/device/frontports.html +++ b/netbox/templates/dcim/device/frontports.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceFrontPortTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceFrontPortTable_config" %}
diff --git a/netbox/templates/dcim/device/interfaces.html b/netbox/templates/dcim/device/interfaces.html index d7f8dff55b..22f6d8be55 100644 --- a/netbox/templates/dcim/device/interfaces.html +++ b/netbox/templates/dcim/device/interfaces.html @@ -4,44 +4,46 @@ {% load static %} {% block content %} - - {% csrf_token %} -
-
-
- -
-
-
-
- {% if request.user.is_authenticated %} - - {% endif %} - - -
+
+
+
+
+
+
+ {% if request.user.is_authenticated %} + + {% endif %} + + +
+
+
+ + + {% csrf_token %} +
diff --git a/netbox/templates/dcim/device/inventory.html b/netbox/templates/dcim/device/inventory.html index c6452cf789..18a0712f36 100644 --- a/netbox/templates/dcim/device/inventory.html +++ b/netbox/templates/dcim/device/inventory.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceInventoryItemTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceInventoryItemTable_config" %}
diff --git a/netbox/templates/dcim/device/modulebays.html b/netbox/templates/dcim/device/modulebays.html index e9c672b576..fc1c9a60dc 100644 --- a/netbox/templates/dcim/device/modulebays.html +++ b/netbox/templates/dcim/device/modulebays.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceModuleBayTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceModuleBayTable_config" %}
diff --git a/netbox/templates/dcim/device/poweroutlets.html b/netbox/templates/dcim/device/poweroutlets.html index 19d8298af6..d312fbbd05 100644 --- a/netbox/templates/dcim/device/poweroutlets.html +++ b/netbox/templates/dcim/device/poweroutlets.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerOutletTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerOutletTable_config" %}
diff --git a/netbox/templates/dcim/device/powerports.html b/netbox/templates/dcim/device/powerports.html index 82c0883928..cf71e81ba2 100644 --- a/netbox/templates/dcim/device/powerports.html +++ b/netbox/templates/dcim/device/powerports.html @@ -4,9 +4,10 @@ {% load static %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerPortTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DevicePowerPortTable_config" %}
diff --git a/netbox/templates/dcim/device/rearports.html b/netbox/templates/dcim/device/rearports.html index 868def4669..73341990fa 100644 --- a/netbox/templates/dcim/device/rearports.html +++ b/netbox/templates/dcim/device/rearports.html @@ -4,9 +4,10 @@ {% load helpers %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceRearPortTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceRearPortTable_config" %}
diff --git a/netbox/templates/ipam/aggregate/prefixes.html b/netbox/templates/ipam/aggregate/prefixes.html index bb574ebf0f..d1b48429ad 100644 --- a/netbox/templates/ipam/aggregate/prefixes.html +++ b/netbox/templates/ipam/aggregate/prefixes.html @@ -12,9 +12,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="PrefixTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="PrefixTable_config" %}
diff --git a/netbox/templates/ipam/iprange/ip_addresses.html b/netbox/templates/ipam/iprange/ip_addresses.html index a13910406f..d9ac77fd0c 100644 --- a/netbox/templates/ipam/iprange/ip_addresses.html +++ b/netbox/templates/ipam/iprange/ip_addresses.html @@ -10,9 +10,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="IPAddressTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="IPAddressTable_config" %}
diff --git a/netbox/templates/ipam/prefix/ip_addresses.html b/netbox/templates/ipam/prefix/ip_addresses.html index b26375ebe1..d734b825fb 100644 --- a/netbox/templates/ipam/prefix/ip_addresses.html +++ b/netbox/templates/ipam/prefix/ip_addresses.html @@ -10,9 +10,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="IPAddressTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="IPAddressTable_config" %}
diff --git a/netbox/templates/ipam/prefix/ip_ranges.html b/netbox/templates/ipam/prefix/ip_ranges.html index b262be8213..268c290a17 100644 --- a/netbox/templates/ipam/prefix/ip_ranges.html +++ b/netbox/templates/ipam/prefix/ip_ranges.html @@ -10,9 +10,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="IPRangeTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="IPRangeTable_config" %}
diff --git a/netbox/templates/ipam/prefix/prefixes.html b/netbox/templates/ipam/prefix/prefixes.html index 039b1ca3ee..5d42596bac 100644 --- a/netbox/templates/ipam/prefix/prefixes.html +++ b/netbox/templates/ipam/prefix/prefixes.html @@ -12,9 +12,10 @@ {% endblock %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="PrefixTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="PrefixTable_config" %}
diff --git a/netbox/templates/ipam/vlan/interfaces.html b/netbox/templates/ipam/vlan/interfaces.html index 51df17edc0..5707d53642 100644 --- a/netbox/templates/ipam/vlan/interfaces.html +++ b/netbox/templates/ipam/vlan/interfaces.html @@ -2,9 +2,10 @@ {% load helpers %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="VLANDevicesTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="VLANDevicesTable_config" %}
{% include 'htmx/table.html' %} diff --git a/netbox/templates/ipam/vlan/vminterfaces.html b/netbox/templates/ipam/vlan/vminterfaces.html index f12e9df868..ef4a0730a4 100644 --- a/netbox/templates/ipam/vlan/vminterfaces.html +++ b/netbox/templates/ipam/vlan/vminterfaces.html @@ -2,9 +2,10 @@ {% load helpers %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="VLANVirtualMachinesTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="VLANVirtualMachinesTable_config" %}
{% include 'htmx/table.html' %} diff --git a/netbox/templates/virtualization/cluster/devices.html b/netbox/templates/virtualization/cluster/devices.html index 075f34c7eb..cb4a1b3ee7 100644 --- a/netbox/templates/virtualization/cluster/devices.html +++ b/netbox/templates/virtualization/cluster/devices.html @@ -3,9 +3,10 @@ {% load render_table from django_tables2 %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="DeviceTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="DeviceTable_config" %}
{% include 'htmx/table.html' %} diff --git a/netbox/templates/virtualization/cluster/virtual_machines.html b/netbox/templates/virtualization/cluster/virtual_machines.html index 8b41912593..953d9f9402 100644 --- a/netbox/templates/virtualization/cluster/virtual_machines.html +++ b/netbox/templates/virtualization/cluster/virtual_machines.html @@ -3,9 +3,10 @@ {% load render_table from django_tables2 %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineTable_config" %}
{% include 'htmx/table.html' %} diff --git a/netbox/templates/virtualization/virtualmachine/interfaces.html b/netbox/templates/virtualization/virtualmachine/interfaces.html index de657b3b39..e3ffb84d4b 100644 --- a/netbox/templates/virtualization/virtualmachine/interfaces.html +++ b/netbox/templates/virtualization/virtualmachine/interfaces.html @@ -3,9 +3,10 @@ {% load helpers %} {% block content %} + {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineVMInterfaceTable_config" %} + {% csrf_token %} - {% include 'inc/table_controls_htmx.html' with table_modal="VirtualMachineVMInterfaceTable_config" %}