diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index bcbbf1739..cadaa2d13 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -377,21 +377,6 @@ 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, @@ -400,7 +385,6 @@ class SiteView(generic.ObjectView): return { 'related_models': related_models, - 'locations': locations, '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 index d4cd58839..8331357f3 100644 --- a/netbox/templates/dcim/inc/nonracked_devices.html +++ b/netbox/templates/dcim/inc/nonracked_devices.html @@ -4,50 +4,10 @@
Non-Racked Devices
-
- {% if nonracked_devices %} - - - - - - - - {% for device in nonracked_devices %} - - - - - {% if device.parent_bay %} - - - {% else %} - - {% endif %} - - {% endfor %} -
NameRoleTypeParent Device
- {{ device }} - {{ device.device_role }}{{ device.device_type }}{{ device.parent_bay.device|linkify }}{{ device.parent_bay }}
- - {% 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' %} @@ -73,4 +33,4 @@ {% endif %} {% endif %} - \ No newline at end of file + diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index 91fdba7be..4e5d627c7 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -132,55 +132,26 @@
{% include 'inc/panels/related_objects.html' with filter_name='site_id' %} {% include 'inc/panels/contacts.html' %} -
-
Locations
-
- {% if locations %} - - - - - - - - {% for location in locations %} - - - - - - - {% endfor %} -
LocationRacksDevices
- {% for i in location.level|as_range %}{% endfor %} - {{ location|linkify }} - - {{ location.rack_count }} - - {{ location.device_count }} - - - - -
- {% else %} - None - {% endif %} -
- {% if perms.dcim.add_location %} - - {% endif %} -
{% include 'inc/panels/image_attachments.html' %} {% plugin_right_page object %}
+
+
Locations
+
+ {% if perms.dcim.add_location %} + + {% endif %} +
{% include 'dcim/inc/nonracked_devices.html' %} {% plugin_full_width_page object %}