Refactor render() on Attr to split out context and reduce boilerplate

This commit is contained in:
Jeremy Stretch
2025-11-05 15:51:36 -05:00
parent dfb08ff521
commit 4edaa48aa7
4 changed files with 105 additions and 140 deletions

View File

@@ -1 +1 @@
<span class="badge color-label" style="background-color: #{{ color }}">&nbsp;</span>
<span class="badge color-label" style="background-color: #{{ value }}">&nbsp;</span>

View File

@@ -5,10 +5,10 @@
{% if linkify %}{{ group|linkify }}{% else %}{{ group }}{% endif %}
</li>
<li class="breadcrumb-item">
{% if linkify %}{{ object|linkify }}{% else %}{{ object }}{% endif %}
{% if linkify %}{{ value|linkify }}{% else %}{{ value }}{% endif %}
</li>
</ol>
{% else %}
{# Display only the object #}
{% if linkify %}{{ object|linkify }}{% else %}{{ object }}{% endif %}
{% if linkify %}{{ value|linkify }}{% else %}{{ value }}{% endif %}
{% endif %}