From 44e8c35e0c99984399d2f38ee9a910985c5040b7 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 29 Sep 2022 15:26:57 -0700 Subject: [PATCH] 9654 total weight on devices --- netbox/templates/dcim/device.html | 25 +++++++++++++++++++++++++ netbox/templates/dcim/rack.html | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index 6cc859749..217592fb1 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -110,6 +110,31 @@ + {% if object.get_total_weight %} +
+
+ Weight +
+
+ + + + + + + + + +
Device Weight + {% if object.device_type.weight %} + {{ object.device_type.weight|floatformat }} {{ object.device_type.get_weight_unit_display }} + {% else %} + {{ ''|placeholder }} + {% endif %} +
Total Weight{{ object.get_total_weight|floatformat }} Kilograms
+
+
+ {% endif %} {% if vc_members %}
diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index acd72a5d1..887f7b734 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -198,7 +198,7 @@ Rack Weight {% if object.weight %} - {{ object.weight }} + {{ object.weight|floatformat }} {{ object.get_weight_unit_display }} {% else %} {{ ''|placeholder }} {% endif %} @@ -206,7 +206,7 @@ Total Weight - {{ object.get_total_weight }} kg + {{ object.get_total_weight|floatformat }} Kilograms