mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
32 lines
1.5 KiB
HTML
32 lines
1.5 KiB
HTML
{% with custom_fields=obj.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="glyphicon glyphicon-ok text-success" title="True"></i>
|
|
{% elif field.type == 'boolean' and value == False %}
|
|
<i class="glyphicon glyphicon-remove text-danger" title="False"></i>
|
|
{% elif field.type == 'url' and value %}
|
|
<a href="{{ value }}">{{ value|truncatechars:70 }}</a>
|
|
{% 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 %}
|