Linkify object attributes

This commit is contained in:
Jeremy Stretch 2023-10-31 16:34:49 -04:00
parent cb499b7e74
commit 47ebc983f5

View File

@ -1,5 +1,11 @@
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">{{ name|bettertitle }}: {{ value }}</span> {% with url=value.get_absolute_url %}
<span class="badge bg-secondary">
{% if url %}<a href="{{ url }}">{% endif %}
{{ name|bettertitle }}: {{ value }}
{% if url %}</a>{% endif %}
</span>
{% endwith %}
{% endfor %} {% endfor %}
""" """