From 23be5694d07ff5126b108e74c53e34c0d08ad9c9 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 12 Jul 2021 12:06:11 -0400 Subject: [PATCH] Move device/VM component tables outside of cards --- .../templates/dcim/device/consoleports.html | 77 ++++++------- .../dcim/device/consoleserverports.html | 77 ++++++------- netbox/templates/dcim/device/devicebays.html | 71 ++++++------ netbox/templates/dcim/device/frontports.html | 77 ++++++------- netbox/templates/dcim/device/interfaces.html | 107 ++++++++---------- netbox/templates/dcim/device/inventory.html | 70 +++++------- .../templates/dcim/device/poweroutlets.html | 77 ++++++------- netbox/templates/dcim/device/powerports.html | 76 ++++++------- netbox/templates/dcim/device/rearports.html | 79 ++++++------- .../virtualization/virtualmachine/base.html | 40 +++---- .../virtualmachine/interfaces.html | 77 ++++++------- 11 files changed, 373 insertions(+), 455 deletions(-) diff --git a/netbox/templates/dcim/device/consoleports.html b/netbox/templates/dcim/device/consoleports.html index dd83e887d..1fcc347b5 100644 --- a/netbox/templates/dcim/device/consoleports.html +++ b/netbox/templates/dcim/device/consoleports.html @@ -4,48 +4,41 @@ {% load static %} {% block content %} -
+ {% csrf_token %} -
-
-
Console Ports
-
- {% if request.user.is_authenticated %} - - {% endif %} -
-
-
- {% render_table consoleport_table 'inc/table.html' %} -
- +
+ {% if request.user.is_authenticated %} + + {% endif %}
- -{% include 'inc/paginator.html' with paginator=consoleport_table.paginator page=consoleport_table.page %} -{% table_config_form consoleport_table %} + {% render_table consoleport_table 'inc/table.html' %} +
+ {% if perms.dcim.change_consoleport %} + + + + {% endif %} + {% if perms.dcim.delete_consoleport %} + + {% endif %} + {% if perms.dcim.add_consoleport %} + + {% endif %} +
+
+ + {% include 'inc/paginator.html' with paginator=consoleport_table.paginator page=consoleport_table.page %} + {% table_config_form consoleport_table %} {% endblock %} diff --git a/netbox/templates/dcim/device/consoleserverports.html b/netbox/templates/dcim/device/consoleserverports.html index 58149b722..17a2f897e 100644 --- a/netbox/templates/dcim/device/consoleserverports.html +++ b/netbox/templates/dcim/device/consoleserverports.html @@ -4,48 +4,41 @@ {% load static %} {% block content %} -
+ {% csrf_token %} -
-
-
Console Server Ports
-
- {% if request.user.is_authenticated %} - - {% endif %} -
-
-
- {% render_table consoleserverport_table 'inc/table.html' %} -
- +
+ {% if request.user.is_authenticated %} + + {% endif %}
- -{% include 'inc/paginator.html' with paginator=consoleserverport_table.paginator page=consoleserverport_table.page %} -{% table_config_form consoleserverport_table %} + {% render_table consoleserverport_table 'inc/table.html' %} +
+ {% if perms.dcim.change_consoleserverport %} + + + + {% endif %} + {% if perms.dcim.delete_consoleserverport %} + + {% endif %} + {% if perms.dcim.add_consoleserverport %} + + {% endif %} +
+
+ + {% include 'inc/paginator.html' with paginator=consoleserverport_table.paginator page=consoleserverport_table.page %} + {% table_config_form consoleserverport_table %} {% endblock %} diff --git a/netbox/templates/dcim/device/devicebays.html b/netbox/templates/dcim/device/devicebays.html index d4d8c6218..ddcac4b06 100644 --- a/netbox/templates/dcim/device/devicebays.html +++ b/netbox/templates/dcim/device/devicebays.html @@ -4,45 +4,38 @@ {% load static %} {% block content %} -
+ {% csrf_token %} -
-
-
Device Bays
-
- {% if request.user.is_authenticated %} - - {% endif %} -
-
-
- {% render_table devicebay_table 'inc/table.html' %} -
- +
+ {% if request.user.is_authenticated %} + + {% endif %}
- -{% include 'inc/paginator.html' with paginator=devicebay_table.paginator page=devicebay_table.page %} -{% table_config_form devicebay_table %} + {% render_table devicebay_table 'inc/table.html' %} +
+ {% if perms.dcim.change_devicebay %} + + + {% endif %} + {% if perms.dcim.delete_devicebay %} + + {% endif %} + {% if perms.dcim.add_devicebay %} + + {% endif %} +
+
+ + {% include 'inc/paginator.html' with paginator=devicebay_table.paginator page=devicebay_table.page %} + {% table_config_form devicebay_table %} {% endblock %} diff --git a/netbox/templates/dcim/device/frontports.html b/netbox/templates/dcim/device/frontports.html index 9ee5fd1f2..9b6f89800 100644 --- a/netbox/templates/dcim/device/frontports.html +++ b/netbox/templates/dcim/device/frontports.html @@ -4,48 +4,41 @@ {% load static %} {% block content %} -
+ {% csrf_token %} -
-
-
Front Ports
-
- {% if request.user.is_authenticated %} - - {% endif %} -
-
-
- {% render_table frontport_table 'inc/table.html' %} -
- +
+ {% if request.user.is_authenticated %} + + {% endif %}
- -{% include 'inc/paginator.html' with paginator=frontport_table.paginator page=frontport_table.page %} -{% table_config_form frontport_table %} + {% render_table frontport_table 'inc/table.html' %} +
+ {% if perms.dcim.change_frontport %} + + + + {% endif %} + {% if perms.dcim.delete_frontport %} + + {% endif %} + {% if perms.dcim.add_frontport %} + + {% endif %} +
+
+ + {% include 'inc/paginator.html' with paginator=frontport_table.paginator page=frontport_table.page %} + {% table_config_form frontport_table %} {% endblock %} diff --git a/netbox/templates/dcim/device/interfaces.html b/netbox/templates/dcim/device/interfaces.html index 32df14c20..8ab18436e 100644 --- a/netbox/templates/dcim/device/interfaces.html +++ b/netbox/templates/dcim/device/interfaces.html @@ -4,65 +4,58 @@ {% load static %} {% block content %} -
+ {% csrf_token %} -
-
-
Interfaces
-
-
- - +
-
+ {% endif %} + + +
-
- {% render_table interface_table 'inc/table.html' %} -
-
-
-{% include 'inc/paginator.html' with paginator=interface_table.paginator page=interface_table.page %} -{% table_config_form interface_table %} + {% render_table interface_table 'inc/table.html' %} +
+ {% if perms.dcim.change_interface %} + + + + {% endif %} + {% if perms.dcim.delete_interface %} + + {% endif %} + {% if perms.dcim.add_interface %} + + {% endif %} +
+
+ + {% include 'inc/paginator.html' with paginator=interface_table.paginator page=interface_table.page %} + {% table_config_form interface_table %} {% endblock %} diff --git a/netbox/templates/dcim/device/inventory.html b/netbox/templates/dcim/device/inventory.html index a64cda042..b97131f17 100644 --- a/netbox/templates/dcim/device/inventory.html +++ b/netbox/templates/dcim/device/inventory.html @@ -4,45 +4,37 @@ {% load static %} {% block content %} -
+ {% csrf_token %} -
-
-
Inventory Items
-
- {% if request.user.is_authenticated %} - - {% endif %} -
-
-
- {% render_table inventoryitem_table 'inc/table.html' %} -
- +
+ {% if request.user.is_authenticated %} + + {% endif %}
- -{% include 'inc/paginator.html' with paginator=inventoryitem_table.paginator page=inventoryitem_table.page %} -{% table_config_form inventoryitem_table %} + {% render_table inventoryitem_table 'inc/table.html' %} +
+ {% if perms.dcim.change_inventoryitem %} + + + {% endif %} + {% if perms.dcim.delete_inventoryitem %} + + {% endif %} + {% if perms.dcim.add_inventoryitem %} + + {% endif %} +
+ + {% include 'inc/paginator.html' with paginator=inventoryitem_table.paginator page=inventoryitem_table.page %} + {% table_config_form inventoryitem_table %} {% endblock %} - diff --git a/netbox/templates/dcim/device/poweroutlets.html b/netbox/templates/dcim/device/poweroutlets.html index d252d0c61..476c86b8e 100644 --- a/netbox/templates/dcim/device/poweroutlets.html +++ b/netbox/templates/dcim/device/poweroutlets.html @@ -4,48 +4,41 @@ {% load static %} {% block content %} -
+ {% csrf_token %} -
-
-
Power Outlets
-
- {% if request.user.is_authenticated %} - - {% endif %} -
-
-
- {% render_table poweroutlet_table 'inc/table.html' %} -
- +
+ {% if request.user.is_authenticated %} + + {% endif %}
- -{% include 'inc/paginator.html' with paginator=poweroutlet_table.paginator page=poweroutlet_table.page %} -{% table_config_form poweroutlet_table %} + {% render_table poweroutlet_table 'inc/table.html' %} +
+ {% if perms.dcim.change_powerport %} + + + + {% endif %} + {% if perms.dcim.delete_poweroutlet %} + + {% endif %} + {% if perms.dcim.add_poweroutlet %} + + {% endif %} +
+
+ + {% include 'inc/paginator.html' with paginator=poweroutlet_table.paginator page=poweroutlet_table.page %} + {% table_config_form poweroutlet_table %} {% endblock %} diff --git a/netbox/templates/dcim/device/powerports.html b/netbox/templates/dcim/device/powerports.html index ae1e575ef..4d25ad306 100644 --- a/netbox/templates/dcim/device/powerports.html +++ b/netbox/templates/dcim/device/powerports.html @@ -4,47 +4,41 @@ {% load static %} {% block content %} -
+ {% csrf_token %} -
-
-
Power Ports
-
- {% if request.user.is_authenticated %} - - {% endif %} -
-
-
- {% render_table powerport_table 'inc/table.html' %} -
- +
+ {% if request.user.is_authenticated %} + + {% endif %}
- -{% include 'inc/paginator.html' with paginator=powerport_table.paginator page=powerport_table.page %} -{% table_config_form powerport_table %} + {% render_table powerport_table 'inc/table.html' %} +
+ {% if perms.dcim.change_powerport %} + + + + {% endif %} + {% if perms.dcim.delete_powerport %} + + {% endif %} + {% if perms.dcim.add_powerport %} + + {% endif %} +
+
+ + {% include 'inc/paginator.html' with paginator=powerport_table.paginator page=powerport_table.page %} + {% table_config_form powerport_table %} {% endblock %} diff --git a/netbox/templates/dcim/device/rearports.html b/netbox/templates/dcim/device/rearports.html index 8d1c56421..0e9260199 100644 --- a/netbox/templates/dcim/device/rearports.html +++ b/netbox/templates/dcim/device/rearports.html @@ -4,48 +4,41 @@ {% load helpers %} {% block content %} -
- {% csrf_token %} -
-
-
Rear Ports
-
- {% if request.user.is_authenticated %} - - {% endif %} -
+ + {% csrf_token %} +
+ {% if request.user.is_authenticated %} + + {% endif %} +
+ {% render_table rearport_table 'inc/table.html' %} +
+ {% if perms.dcim.change_rearport %} + + + + {% endif %} + {% if perms.dcim.delete_rearport %} + + {% endif %} + {% if perms.dcim.add_rearport %} + -
- {% render_table rearport_table 'inc/table.html' %} -
- -
- - {% include 'inc/paginator.html' with paginator=rearport_table.paginator page=rearport_table.page %} - {% table_config_form rearport_table %} + {% endif %} +
+
+ + {% include 'inc/paginator.html' with paginator=rearport_table.paginator page=rearport_table.page %} + {% table_config_form rearport_table %} {% endblock %} diff --git a/netbox/templates/virtualization/virtualmachine/base.html b/netbox/templates/virtualization/virtualmachine/base.html index bcda700fc..3c0d8fe93 100644 --- a/netbox/templates/virtualization/virtualmachine/base.html +++ b/netbox/templates/virtualization/virtualmachine/base.html @@ -17,32 +17,20 @@ {% endif %} {% endblock %} -{% block tabs %} - + {% endif %} {% endblock %} diff --git a/netbox/templates/virtualization/virtualmachine/interfaces.html b/netbox/templates/virtualization/virtualmachine/interfaces.html index 3c81a76ec..0a793f8a6 100644 --- a/netbox/templates/virtualization/virtualmachine/interfaces.html +++ b/netbox/templates/virtualization/virtualmachine/interfaces.html @@ -4,47 +4,40 @@ {% load static %} {% block content %} -
- {% csrf_token %} -
-
-
Interfaces
-
-
- - {% if request.user.is_authenticated %} - - {% endif %} -
-
-
-
- {% render_table interface_table 'inc/table.html' %} -
- + + {% csrf_token %} +
+
+ + {% if request.user.is_authenticated %} + + {% endif %}
- - {% table_config_form interface_table %} +
+ {% render_table interface_table 'inc/table.html' %} +
+ {% if perms.virtualization.change_vminterface %} + + + {% endif %} + {% if perms.virtualization.delete_vminterface %} + + {% endif %} + {% if perms.virtualization.add_vminterface %} + + {% endif %} +
+
+ + {% table_config_form interface_table %} {% endblock %}