Skip to content

Commit e0fb3cc

Browse files
theskumarwes-otf
authored andcommitted
Better rendering of checkbox selection (HyphaApp#4601)
Use "Yes"/"No" with icons, instead of "True" and "False"
1 parent c97d470 commit e0fb3cc

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

hypha/apply/stream_forms/blocks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ class CheckboxFieldBlock(OptionalFormFieldBlock):
188188
class Meta:
189189
label = _("Checkbox field")
190190
icon = "tick-inverse"
191+
template = "stream_forms/render_checkbox_field.html"
191192

192193
def get_searchable_content(self, value, data):
193194
return None
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% extends "stream_forms/render_field.html" %}
2+
{% load heroicons i18n %}
3+
4+
{% block data_display %}
5+
<span class="flex gap-2 items-center">
6+
{% if data == "True" %}
7+
{% heroicon_outline "check-circle" class="size-5 stroke-success" aria_hidden=true %}
8+
{% trans "Yes" %}
9+
{% elif data == "False" %}
10+
{% heroicon_outline "x-circle" class="size-5 stroke-error" aria_hidden=true %}
11+
{% trans "No" %}
12+
{% else %}
13+
{% trans "No selection" %}
14+
{% endif %}
15+
</span>
16+
{% endblock %}

0 commit comments

Comments
 (0)