2021-10-14 14:48:00 -04:00
|
|
|
{% load helpers %}
|
|
|
|
|
2020-11-19 13:53:37 -05:00
|
|
|
{% with custom_fields=object.get_custom_fields %}
|
2018-07-20 19:56:04 -04:00
|
|
|
{% if custom_fields %}
|
2021-03-13 02:19:42 -07:00
|
|
|
<div class="card">
|
2022-01-05 17:05:54 -05:00
|
|
|
<h5 class="card-header">Custom Fields</h5>
|
2021-03-13 02:19:42 -07:00
|
|
|
<div class="card-body">
|
|
|
|
<table class="table table-hover attr-table">
|
|
|
|
{% for field, value in custom_fields.items %}
|
|
|
|
<tr>
|
2022-01-05 17:05:54 -05:00
|
|
|
<td>
|
|
|
|
<span title="{{ field.description|escape }}">{{ field }}</span>
|
|
|
|
</td>
|
2021-03-13 02:19:42 -07:00
|
|
|
<td>
|
2022-02-16 09:07:01 -05:00
|
|
|
{% if field.type == 'integer' and value is not None %}
|
|
|
|
{{ value }}
|
|
|
|
{% elif field.type == 'longtext' and value %}
|
2022-02-09 16:01:58 -05:00
|
|
|
{{ value|markdown }}
|
2021-10-14 14:48:00 -04:00
|
|
|
{% elif field.type == 'boolean' and value == True %}
|
2021-12-29 10:26:42 -05:00
|
|
|
{% checkmark value true="True" %}
|
2021-03-13 02:19:42 -07:00
|
|
|
{% elif field.type == 'boolean' and value == False %}
|
2021-12-29 10:26:42 -05:00
|
|
|
{% checkmark value false="False" %}
|
2021-03-13 02:19:42 -07:00
|
|
|
{% elif field.type == 'url' and value %}
|
|
|
|
<a href="{{ value }}">{{ value|truncatechars:70 }}</a>
|
2021-10-28 10:29:14 -04:00
|
|
|
{% elif field.type == 'json' and value %}
|
2022-02-09 16:01:58 -05:00
|
|
|
<pre>{{ value|json }}</pre>
|
2021-03-13 02:19:42 -07:00
|
|
|
{% elif field.type == 'multiselect' and value %}
|
|
|
|
{{ value|join:", " }}
|
2021-12-30 17:03:41 -05:00
|
|
|
{% elif field.type == 'object' and value %}
|
|
|
|
<a href="{{ value.get_absolute_url }}">{{ value }}</a>
|
2022-01-05 17:05:54 -05:00
|
|
|
{% elif field.type == 'multiobject' and value %}
|
2022-02-16 09:07:01 -05:00
|
|
|
<ul>
|
|
|
|
{% for obj in value %}
|
|
|
|
<li><a href="{{ obj.get_absolute_url }}">{{ obj }}</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% elif value %}
|
2021-03-13 02:19:42 -07:00
|
|
|
{{ value }}
|
|
|
|
{% elif field.required %}
|
|
|
|
<span class="text-warning">Not defined</span>
|
|
|
|
{% else %}
|
|
|
|
<span class="text-muted">—</span>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
2018-07-20 19:56:04 -04:00
|
|
|
</div>
|
2016-08-15 15:24:23 -04:00
|
|
|
</div>
|
2018-07-20 19:56:04 -04:00
|
|
|
{% endif %}
|
|
|
|
{% endwith %}
|