diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py
index 2f5da4ce1..211a58928 100644
--- a/netbox/dcim/views.py
+++ b/netbox/dcim/views.py
@@ -398,32 +398,8 @@ class SiteView(generic.ObjectView):
(Circuit.objects.restrict(request.user, 'view').filter(terminations__site=instance).distinct(), 'site_id'),
)
- locations = Location.objects.add_related_count(
- Location.objects.all(),
- Rack,
- 'location',
- 'rack_count',
- cumulative=True
- )
- locations = Location.objects.add_related_count(
- locations,
- Device,
- 'location',
- 'device_count',
- cumulative=True
- ).restrict(request.user, 'view').filter(site=instance)
-
- nonracked_devices = Device.objects.filter(
- site=instance,
- rack__isnull=True,
- parent_bay__isnull=True
- ).prefetch_related('device_type__manufacturer', 'parent_bay', 'device_role')
-
return {
'related_models': related_models,
- 'locations': locations,
- 'nonracked_devices': nonracked_devices.order_by('-pk')[:10],
- 'total_nonracked_devices_count': nonracked_devices.count(),
}
@@ -495,16 +471,8 @@ class LocationView(generic.ObjectView):
(Device.objects.restrict(request.user, 'view').filter(location__in=locations), 'location_id'),
)
- nonracked_devices = Device.objects.filter(
- location=instance,
- rack__isnull=True,
- parent_bay__isnull=True
- ).prefetch_related('device_type__manufacturer', 'parent_bay', 'device_role')
-
return {
'related_models': related_models,
- 'nonracked_devices': nonracked_devices.order_by('-pk')[:10],
- 'total_nonracked_devices_count': nonracked_devices.count(),
}
diff --git a/netbox/templates/dcim/inc/nonracked_devices.html b/netbox/templates/dcim/inc/nonracked_devices.html
deleted file mode 100644
index d4cd58839..000000000
--- a/netbox/templates/dcim/inc/nonracked_devices.html
+++ /dev/null
@@ -1,76 +0,0 @@
-{% load helpers %}
-
-
-
-
- {% if nonracked_devices %}
-
-
- Name |
- Role |
- Type |
- Parent Device |
-
- {% for device in nonracked_devices %}
-
-
- {{ device }}
- |
- {{ device.device_role }} |
- {{ device.device_type }} |
- {% if device.parent_bay %}
- {{ device.parent_bay.device|linkify }} |
- {{ device.parent_bay }} |
- {% else %}
- — |
- {% endif %}
-
- {% endfor %}
-
-
- {% if total_nonracked_devices_count > nonracked_devices.count %}
- {% if object|meta:'verbose_name' == 'site' %}
-
- Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices (
View full list)
-
- {% elif object|meta:'verbose_name' == 'location' %}
-
- Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices (
View full list)
-
- {% endif %}
- {% endif %}
-
- {% else %}
-
- None
-
- {% endif %}
-
-
- {% if perms.dcim.add_device %}
- {% if object|meta:'verbose_name' == 'rack' %}
-
- {% elif object|meta:'verbose_name' == 'site' %}
-
- {% elif object|meta:'verbose_name' == 'location' %}
-
- {% endif %}
- {% endif %}
-
\ No newline at end of file
diff --git a/netbox/templates/dcim/location.html b/netbox/templates/dcim/location.html
index 795aeb35f..48700588a 100644
--- a/netbox/templates/dcim/location.html
+++ b/netbox/templates/dcim/location.html
@@ -65,7 +65,6 @@
{% include 'inc/panels/related_objects.html' %}
- {% include 'dcim/inc/nonracked_devices.html' %}
{% include 'inc/panels/image_attachments.html' %}
{% plugin_right_page object %}
@@ -78,6 +77,27 @@
hx-get="{% url 'dcim:location_list' %}?parent_id={{ object.pk }}"
hx-trigger="load"
>
+ {% if perms.dcim.add_location %}
+
+ {% endif %}
+
+
+
+
+ {% if perms.dcim.add_device %}
+
+ {% endif %}
{% plugin_full_width_page object %}
diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html
index 697737ceb..e0f44261f 100644
--- a/netbox/templates/dcim/site.html
+++ b/netbox/templates/dcim/site.html
@@ -131,56 +131,40 @@
{% include 'inc/panels/related_objects.html' with filter_name='site_id' %}
-
-
-
- {% if locations %}
-
- {% else %}
-
None
- {% endif %}
-
- {% if perms.dcim.add_location %}
-
- {% endif %}
-
{% include 'inc/panels/image_attachments.html' %}
{% plugin_right_page object %}
- {% include 'dcim/inc/nonracked_devices.html' %}
+
+
+
+ {% if perms.dcim.add_location %}
+
+ {% endif %}
+
+
+
+
+ {% if perms.dcim.add_device %}
+
+ {% endif %}
+
{% plugin_full_width_page object %}