Introduce a "checkmark" template tag to render boolean values #5845

Closed
opened 2025-12-29 19:33:26 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Dec 29, 2021).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Introduce a custom checkmark template tag to replace this common pattern:

{% if value %}
  <i class="mdi mdi-check-bold text-success" title="Yes"></i>
{% else %}
  <i class="mdi mdi-close-thick text-danger" title="No"></i>
{% endif %}

Justification

Reduces cruft in the templates

Originally created by @jeremystretch on GitHub (Dec 29, 2021). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Introduce a custom `checkmark` template tag to replace this common pattern: ``` {% if value %} <i class="mdi mdi-check-bold text-success" title="Yes"></i> {% else %} <i class="mdi mdi-close-thick text-danger" title="No"></i> {% endif %} ``` ### Justification Reduces cruft in the templates
adam added the status: acceptedtype: housekeeping labels 2025-12-29 19:33:26 +01:00
adam closed this issue 2025-12-29 19:33:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5845