1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Abhimanyu Saharan 4e49f4a434 Adds tooltip on custom field (#12505)
* adds tooltip on custom field #12131

* adds description field check

* fixed field name

* updated code to match the panel

* added escape filter on description
2023-05-09 10:20:02 -04:00

36 lines
1.1 KiB
HTML

{% load helpers %}
{% with custom_fields=object.get_custom_fields_by_group %}
{% if custom_fields %}
<div class="card">
<h5 class="card-header">Custom Fields</h5>
<div class="card-body">
{% for group_name, fields in custom_fields.items %}
{% if group_name %}
<h6>{{ group_name }}</h6>
{% endif %}
<table class="table table-hover attr-table">
{% for field, value in fields.items %}
<tr>
<th scope="row">{{ field }}
{% if field.description %}
<i
class="mdi mdi-information text-primary"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="{{ field.description|escape }}"
></i>
{% endif %}
</th>
<td>
{% customfield_value field value %}
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</div>
</div>
{% endif %}
{% endwith %}