mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes: #17126 - Respect the weight unit of the DeviceType when displaying the Device detail (#17579)
* Respect the weight unit of the DeviceType when displaying the Device details * Reuse the same weight formatting construct as in rack.html, and add placeholder in rack if empty
This commit is contained in:
parent
8420af8562
commit
cfb5696d29
@ -325,6 +325,7 @@
|
||||
<td>
|
||||
{% if object.total_weight %}
|
||||
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
||||
({{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %})
|
||||
{% else %}
|
||||
{{ ''|placeholder }}
|
||||
{% endif %}
|
||||
|
@ -103,8 +103,12 @@
|
||||
<tr>
|
||||
<th scope="row">{% trans "Total Weight" %}</th>
|
||||
<td>
|
||||
{% if object.total_weight %}
|
||||
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
||||
({{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %})
|
||||
{% else %}
|
||||
{{ ''|placeholder }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
Loading…
Reference in New Issue
Block a user