mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 07:56:44 -06:00
Simplify template code
This commit is contained in:
parent
f181b14858
commit
bfbcc6bbac
@ -1,11 +1,7 @@
|
|||||||
SEARCH_RESULT_ATTRS = """
|
SEARCH_RESULT_ATTRS = """
|
||||||
{% for name, value in record.display_attrs.items %}
|
{% for name, value in record.display_attrs.items %}
|
||||||
{% with url=value.get_absolute_url %}
|
<span class="badge bg-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ name|bettertitle }}">
|
||||||
<span class="badge bg-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ name|bettertitle }}">
|
{{ value|linkify }}
|
||||||
{% if url %}<a href="{{ url }}">{% endif %}
|
</span>
|
||||||
{{ value }}
|
|
||||||
{% if url %}</a>{% endif %}
|
|
||||||
</span>
|
|
||||||
{% endwith %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user