mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 07:56:44 -06:00
Use tooltips to display long strings
This commit is contained in:
parent
326c954782
commit
3bcc4e13bf
@ -1,7 +1,18 @@
|
|||||||
SEARCH_RESULT_ATTRS = """
|
SEARCH_RESULT_ATTRS = """
|
||||||
{% for name, value in record.display_attrs.items %}
|
{% for name, value in record.display_attrs.items %}
|
||||||
<span class="badge bg-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ name|bettertitle }}">
|
<span class="badge bg-secondary"
|
||||||
{{ value|linkify }}
|
{% if value|length > 40 %} data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ value }}"{% endif %}
|
||||||
|
>
|
||||||
|
{{ name|bettertitle }}:
|
||||||
|
{% with url=value.get_absolute_url %}
|
||||||
|
{% if url %}<a href="url">{% endif %}
|
||||||
|
{% if value|length > 40 %}
|
||||||
|
{{ value|truncatechars:"40" }}
|
||||||
|
{% else %}
|
||||||
|
{{ value }}
|
||||||
|
{% endif %}
|
||||||
|
{% if url %}</a>{% endif %}
|
||||||
|
{% endwith %}
|
||||||
</span>
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user