From 1cffbb21bb8e44ff67a38db5887cfbd244e57e88 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 3 Nov 2025 15:04:29 -0500 Subject: [PATCH] Restore original object templates --- netbox/templates/dcim/device.html | 187 ++++++++++++++++++++++++++- netbox/templates/dcim/location.html | 39 +++++- netbox/templates/dcim/rack.html | 67 +++++++++- netbox/templates/dcim/region.html | 18 ++- netbox/templates/dcim/site.html | 96 +++++++++++++- netbox/templates/dcim/sitegroup.html | 18 ++- 6 files changed, 413 insertions(+), 12 deletions(-) diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index 1ef8a406d..f8b8e95c2 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -11,7 +11,115 @@ {% block content %}
- {{ device_panel }} +
+

{% trans "Device" %}

+ + + + + + + + + + + + + + {% if object.virtual_chassis %} + + + + + {% endif %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans "Region" %}{% nested_tree object.site.region %}
{% trans "Site" %}{{ object.site|linkify }}
{% trans "Location" %}{% nested_tree object.location %}
{% trans "Virtual Chassis" %}{{ object.virtual_chassis|linkify }}
{% trans "Rack" %} + {% if object.rack %} + {{ object.rack|linkify }} + + + + {% else %} + {{ ''|placeholder }} + {% endif %} +
{% trans "Position" %} + {% if object.parent_bay %} + {% with object.parent_bay.device as parent %} + {{ parent|linkify }} / {{ object.parent_bay }} + {% if parent.position %} + (U{{ parent.position|floatformat }} / {{ parent.get_face_display }}) + {% endif %} + {% endwith %} + {% elif object.rack and object.position %} + U{{ object.position|floatformat }} / {{ object.get_face_display }} + {% elif object.rack and object.device_type.u_height %} + {% trans "Not racked" %} + {% else %} + {{ ''|placeholder }} + {% endif %} +
{% trans "GPS Coordinates" %} + {% if object.latitude and object.longitude %} + {% if config.MAPS_URL %} + + {% endif %} + {{ object.latitude }}, {{ object.longitude }} + {% else %} + {{ ''|placeholder }} + {% endif %} +
{% trans "Tenant" %} + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / + {% endif %} + {{ object.tenant|linkify|placeholder }} +
{% trans "Device Type" %} + {{ object.device_type|linkify:"full_name" }} ({{ object.device_type.u_height|floatformat }}U) +
{% trans "Description" %}{{ object.description|placeholder }}
{% trans "Airflow" %} + {{ object.get_airflow_display|placeholder }} +
{% trans "Serial Number" %}{{ object.serial|placeholder }}
{% trans "Asset Tag" %}{{ object.asset_tag|placeholder }}
{% trans "Config Template" %}{{ object.config_template|linkify|placeholder }}
+
{% if vc_members %}

@@ -69,7 +177,82 @@ {% plugin_left_page object %}

- {{ management_panel }} +
+

{% trans "Management" %}

+ + + + + + + + + + + + + + + + + + + + + + + + + + {% if object.cluster %} + + + + + {% endif %} +
{% trans "Status" %}{% badge object.get_status_display bg_color=object.get_status_color %}
{% trans "Role" %}{{ object.role|linkify }}
{% trans "Platform" %}{{ object.platform|linkify|placeholder }}
{% trans "Primary IPv4" %} + {% if object.primary_ip4 %} + {{ object.primary_ip4.address.ip }} + {% if object.primary_ip4.nat_inside %} + ({% trans "NAT for" %} {{ object.primary_ip4.nat_inside.address.ip }}) + {% elif object.primary_ip4.nat_outside.exists %} + ({% trans "NAT" %}: {% for nat in object.primary_ip4.nat_outside.all %}{{ nat.address.ip }}{% if not forloop.last %}, {% endif %}{% endfor %}) + {% endif %} + {% copy_content "primary_ip4" %} + {% else %} + {{ ''|placeholder }} + {% endif %} +
{% trans "Primary IPv6" %} + {% if object.primary_ip6 %} + {{ object.primary_ip6.address.ip }} + {% if object.primary_ip6.nat_inside %} + ({% trans "NAT for" %} {{ object.primary_ip6.nat_inside.address.ip }}) + {% elif object.primary_ip6.nat_outside.exists %} + ({% trans "NAT" %}: {% for nat in object.primary_ip6.nat_outside.all %}{{ nat.address.ip }}{% if not forloop.last %}, {% endif %}{% endfor %}) + {% endif %} + {% copy_content "primary_ip6" %} + {% else %} + {{ ''|placeholder }} + {% endif %} +
Out-of-band IP + {% if object.oob_ip %} + {{ object.oob_ip.address.ip }} + {% if object.oob_ip.nat_inside %} + ({% trans "NAT for" %} {{ object.oob_ip.nat_inside.address.ip }}) + {% elif object.oob_ip.nat_outside.exists %} + ({% trans "NAT" %}: {% for nat in object.oob_ip.nat_outside.all %}{{ nat.address.ip }}{% if not forloop.last %}, {% endif %}{% endfor %}) + {% endif %} + {% copy_content "oob_ip" %} + {% else %} + {{ ''|placeholder }} + {% endif %} +
{% trans "Cluster" %} + {% if object.cluster.group %} + {{ object.cluster.group|linkify }} / + {% endif %} + {{ object.cluster|linkify }} +
+
{% if object.powerports.exists and object.poweroutlets.exists %}

{% trans "Power Utilization" %}

diff --git a/netbox/templates/dcim/location.html b/netbox/templates/dcim/location.html index 861a2adef..dfd0c32b3 100644 --- a/netbox/templates/dcim/location.html +++ b/netbox/templates/dcim/location.html @@ -22,7 +22,44 @@ {% block content %}
- {{ location_panel }} +
+

{% trans "Location" %}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans "Name" %}{{ object.name }}
{% trans "Description" %}{{ object.description|placeholder }}
{% trans "Site" %}{{ object.site|linkify }}
{% trans "Parent" %}{{ object.parent|linkify|placeholder }}
{% trans "Status" %}{% badge object.get_status_display bg_color=object.get_status_color %}
{% trans "Tenant" %} + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / + {% endif %} + {{ object.tenant|linkify|placeholder }} +
{% trans "Facility" %}{{ object.facility|placeholder }}
+
{% include 'inc/panels/tags.html' %} {% include 'inc/panels/custom_fields.html' %} {% include 'inc/panels/comments.html' %} diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index f5eddcd3f..eec4d63a5 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -9,7 +9,72 @@ {% block content %}
- {{ rack_panel }} +
+

{% trans "Rack" %}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans "Region" %}{% nested_tree object.site.region %}
{% trans "Site" %}{{ object.site|linkify }}
{% trans "Location" %}{% nested_tree object.location %}
{% trans "Facility ID" %}{{ object.facility_id|placeholder }}
{% trans "Tenant" %} + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / + {% endif %} + {{ object.tenant|linkify|placeholder }} +
{% trans "Status" %}{% badge object.get_status_display bg_color=object.get_status_color %}
{% trans "Rack Type" %}{{ object.rack_type|linkify:"full_name"|placeholder }}
{% trans "Role" %}{{ object.role|linkify|placeholder }}
{% trans "Description" %}{{ object.description|placeholder }}
{% trans "Serial Number" %}{{ object.serial|placeholder }}
{% trans "Asset Tag" %}{{ object.asset_tag|placeholder }}
{% trans "Airflow" %}{{ object.get_airflow_display|placeholder }}
{% trans "Space Utilization" %}{% utilization_graph object.get_utilization %}
{% trans "Power Utilization" %}{% utilization_graph object.get_power_utilization %}
+
{% include 'dcim/inc/panels/racktype_dimensions.html' %} {% include 'dcim/inc/panels/racktype_numbering.html' %}
diff --git a/netbox/templates/dcim/region.html b/netbox/templates/dcim/region.html index 28f4b6127..f11868b0a 100644 --- a/netbox/templates/dcim/region.html +++ b/netbox/templates/dcim/region.html @@ -22,7 +22,23 @@ {% block content %}
- {{ region_panel }} +
+

{% trans "Region" %}

+ + + + + + + + + + + + + +
{% trans "Name" %}{{ object.name }}
{% trans "Description" %}{{ object.description|placeholder }}
{% trans "Parent" %}{{ object.parent|linkify|placeholder }}
+
{% include 'inc/panels/tags.html' %} {% include 'inc/panels/custom_fields.html' %} {% include 'inc/panels/comments.html' %} diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index f4e9a5d02..cf65961d9 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -24,16 +24,100 @@ {% block content %}
- {{ site_panel }} +
+

{% trans "Site" %}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans "Region" %} + {% nested_tree object.region %} +
{% trans "Group" %} + {% nested_tree object.group %} +
{% trans "Status" %}{% badge object.get_status_display bg_color=object.get_status_color %}
{% trans "Tenant" %} + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / + {% endif %} + {{ object.tenant|linkify|placeholder }} +
{% trans "Facility" %}{{ object.facility|placeholder }}
{% trans "Description" %}{{ object.description|placeholder }}
{% trans "Time Zone" %} + {% if object.time_zone %} + {{ object.time_zone }} ({% trans "UTC" %} {{ object.time_zone|tzoffset }})
+ {% trans "Site time" %}: {% timezone object.time_zone %}{% now 'Y-m-d H:i' %}{% endtimezone %} + {% else %} + {{ ''|placeholder }} + {% endif %} +
{% trans "Physical Address" %} + {% if object.physical_address %} + {{ object.physical_address|linebreaksbr }} + {% if config.MAPS_URL %} + + {% trans "Map" %} + + {% endif %} + {% else %} + {{ ''|placeholder }} + {% endif %} +
{% trans "Shipping Address" %}{{ object.shipping_address|linebreaksbr|placeholder }}
{% trans "GPS Coordinates" %} + {% if object.latitude and object.longitude %} + {% if config.MAPS_URL %} + + {% endif %} + {{ object.latitude }}, {{ object.longitude }} + {% else %} + {{ ''|placeholder }} + {% endif %} +
+
{% include 'inc/panels/custom_fields.html' %} {% include 'inc/panels/tags.html' %} {% include 'inc/panels/comments.html' %} {% plugin_left_page object %} -
-
- {% include 'inc/panels/related_objects.html' with filter_name='site_id' %} - {% include 'inc/panels/image_attachments.html' %} - {% plugin_right_page object %} +
+
+ {% include 'inc/panels/related_objects.html' with filter_name='site_id' %} + {% include 'inc/panels/image_attachments.html' %} + {% plugin_right_page object %}
diff --git a/netbox/templates/dcim/sitegroup.html b/netbox/templates/dcim/sitegroup.html index 63e240dc6..dc9aca6f5 100644 --- a/netbox/templates/dcim/sitegroup.html +++ b/netbox/templates/dcim/sitegroup.html @@ -22,7 +22,23 @@ {% block content %}
- {{ sitegroup_panel }} +
+

{% trans "Site Group" %}

+ + + + + + + + + + + + + +
{% trans "Name" %}{{ object.name }}
{% trans "Description" %}{{ object.description|placeholder }}
{% trans "Parent" %}{{ object.parent|linkify|placeholder }}
+
{% include 'inc/panels/tags.html' %} {% include 'inc/panels/custom_fields.html' %} {% include 'inc/panels/comments.html' %}