1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Files
Jeremy Stretch 77a4300888 Closes #15618: Always use ISO 8601 date & time formatting (#15737)
* Introduce the isodate(), isotime(), and isodatetime() template filters

* Display the relative time on mouse hover

* Render journal entry times in ISO 8601 format

* Use ISO 8601 format when displaying dates & times in a table

* Standardize the use of DateTimeColumn across all tables
2024-04-17 11:46:47 -04:00

34 lines
1.2 KiB
HTML

{% load helpers %}
{% load i18n %}
{% if customfield.type == 'integer' and value is not None %}
{{ value }}
{% elif customfield.type == 'longtext' and value %}
{{ value|markdown }}
{% elif customfield.type == 'boolean' and value == True %}
{% checkmark value true="True" %}
{% elif customfield.type == 'boolean' and value == False %}
{% checkmark value false="False" %}
{% elif customfield.type == 'date' and value %}
{{ value|isodate }}
{% elif customfield.type == 'datetime' and value %}
{{ value|isodate }} {{ value|isodatetime }}
{% elif customfield.type == 'url' and value %}
<a href="{{ value }}">{{ value|truncatechars:70 }}</a>
{% elif customfield.type == 'json' and value %}
<pre>{{ value|json }}</pre>
{% elif customfield.type == 'multiselect' and value %}
{{ value|join:", " }}
{% elif customfield.type == 'object' and value %}
{{ value|linkify }}
{% elif customfield.type == 'multiobject' and value %}
{% for object in value %}
{{ object|linkify }}{% if not forloop.last %}<br />{% endif %}
{% endfor %}
{% elif value %}
{{ value }}
{% elif customfield.required %}
<span class="text-warning"><i class="mdi mdi-alert"></i> {% trans "Not defined" %}</span>
{% else %}
{{ ''|placeholder }}
{% endif %}