Skip to content

Commit 4e49f4a

Browse files
authored
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
1 parent c55c14e commit 4e49f4a

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

netbox/templates/circuits/inc/circuit_termination.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,16 @@ <h5>Termination {{ side }}</h5>
132132
</tr>
133133
{% for field, value in fields.items %}
134134
<tr>
135-
<td>
136-
<span title="{{ field.description|escape }}">{{ field }}</span>
137-
</td>
135+
<th scope="row">{{ field }}
136+
{% if field.description %}
137+
<i
138+
class="mdi mdi-information text-primary"
139+
data-bs-toggle="tooltip"
140+
data-bs-placement="right"
141+
title="{{ field.description|escape }}"
142+
></i>
143+
{% endif %}
144+
</th>
138145
<td>
139146
{% customfield_value field value %}
140147
</td>

netbox/templates/inc/panels/custom_fields.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ <h6>{{ group_name }}</h6>
1212
<table class="table table-hover attr-table">
1313
{% for field, value in fields.items %}
1414
<tr>
15-
<th scope="row">
16-
<span title="{{ field.description|escape }}">{{ field }}</span>
15+
<th scope="row">{{ field }}
16+
{% if field.description %}
17+
<i
18+
class="mdi mdi-information text-primary"
19+
data-bs-toggle="tooltip"
20+
data-bs-placement="right"
21+
title="{{ field.description|escape }}"
22+
></i>
23+
{% endif %}
1724
</th>
1825
<td>
1926
{% customfield_value field value %}

0 commit comments

Comments
 (0)