mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
With this commit all dates in the UI are now consistently displayed. I changed the long date format as suggested by @xkilian and confirmed by my own research. * DATETIME_FORMAT * Before July 20, 2020 4:52 p.m. * Now 20th July, 2020 16:52 "20th July, 2020" would be spoken as "the 20th of July, 2020" but the "the" and "of" are never written. The only exception is `object_list.html`. I tried it but there it does not work so easily because the dates are passed to Jinja as SafeString.
37 lines
1.8 KiB
HTML
37 lines
1.8 KiB
HTML
{% load helpers %}
|
|
{% with custom_fields=object.get_custom_fields %}
|
|
{% if custom_fields %}
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Custom Fields</strong>
|
|
</div>
|
|
<table class="table table-hover panel-body attr-table">
|
|
{% for field, value in custom_fields.items %}
|
|
<tr>
|
|
<td><span title="{{ field.description }}">{{ field }}</span></td>
|
|
<td>
|
|
{% if field.type == 'boolean' and value == True %}
|
|
<i class="mdi mdi-check-bold text-success" title="True"></i>
|
|
{% elif field.type == 'boolean' and value == False %}
|
|
<i class="mdi mdi-close-thick text-danger" title="False"></i>
|
|
{% elif field.type == 'url' and value %}
|
|
<a href="{{ value }}">{{ value|truncatechars:70 }}</a>
|
|
{% elif field.type == 'multiselect' and value %}
|
|
{{ value|join:", " }}
|
|
{% elif field.type == 'date' and value %}
|
|
{{ value|annotated_date }}
|
|
{% elif value is not None %}
|
|
{{ value }}
|
|
{% elif field.required %}
|
|
<span class="text-warning">Not defined</span>
|
|
{% else %}
|
|
<span class="text-muted">—</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% endwith %}
|