mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-02 05:46:25 -06:00
Reuse the same weight formatting construct as in rack.html, and add placeholder in rack if empty
This commit is contained in:
parent
f769f773f1
commit
0c90284448
@ -324,11 +324,8 @@
|
||||
<th scope="row">{% trans "Weight" %}</th>
|
||||
<td>
|
||||
{% if object.total_weight %}
|
||||
{% if object.device_type.weight_unit == "lb" %}
|
||||
{{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %}
|
||||
{% elif object.device_type.weight_unit == "kg" %}
|
||||
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
||||
{% endif %}
|
||||
{{ 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>
|
||||
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
||||
({{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %})
|
||||
{% 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