yksa-web-kit/yksa_web/templates/yksa/ui/_expect_icon.html
2026-08-17 22:42:04 +08:00

15 lines
841 B
HTML

{% load i18n %}{% comment %}
Inline result of an `expect:` assertion on a captured value.
{% include "yksa/ui/_expect_icon.html" with state=field.expect_state %}
state pass | fail | unknown (anything else renders nothing)
Deliberately not a yksa/ui/_state.html state: this annotates one value inside a
row that already carries a state of its own, and a second pill there would read
as a second object.
{% endcomment %}{% spaceless %}
{% if state == 'pass' %}<i class="bi bi-check-circle-fill text-success" title="{% trans 'Within expected range' %}"></i>
{% elif state == 'fail' %}<i class="bi bi-x-circle-fill text-danger" title="{% trans 'Outside expected range' %}"></i>
{% elif state == 'unknown' %}<i class="bi bi-question-circle text-body-secondary" title="{% trans 'Not yet evaluable' %}"></i>{% endif %}
{% endspaceless %}