mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-04 06:38:16 -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>
|
<th scope="row">{% trans "Weight" %}</th>
|
||||||
<td>
|
<td>
|
||||||
{% if object.total_weight %}
|
{% 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" %}
|
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
||||||
{% endif %}
|
({{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %})
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ ''|placeholder }}
|
{{ ''|placeholder }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -103,8 +103,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{% trans "Total Weight" %}</th>
|
<th scope="row">{% trans "Total Weight" %}</th>
|
||||||
<td>
|
<td>
|
||||||
|
{% if object.total_weight %}
|
||||||
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
||||||
({{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %})
|
({{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %})
|
||||||
|
{% else %}
|
||||||
|
{{ ''|placeholder }}
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user