1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| {% func Boolean(x any, nullable bool, k string) %}{% stripspace %} {% code b, isBool := x.(bool) %} {% if isBool && b %} <label class="radio-label"><input value="true" name="{%s k %}" type="radio" checked="checked" /> true</label> {% else %} <label class="radio-label"><input value="true" name="{%s k %}" type="radio" /> true</label> {% endif %}
{% if isBool && !b %} <label class="radio-label"><input value="false" name="{%s k %}" type="radio" checked="checked" /> false</label> {% else %} <label class="radio-label"><input value="false" name="{%s k %}" type="radio" /> false</label> {% endif %}
{% if nullable %} {% if x == nil %} <label class="radio-label"><input value="∅" name="{%s k %}" type="radio" checked="checked" /> nil</label> {% else %} <label class="radio-label"><input value="∅" name="{%s k %}" type="radio" /> nil</label> {% endif %} {% endif %} {% endstripspace %}{% endfunc %}
|