formidable/internal/server/template/blocks/form_input_boolean.html.tmpl

22 lines
828 B
Cheetah
Raw Normal View History

2022-03-22 09:21:55 +01:00
{{define "form_input_boolean"}}
{{ $fullProperty := getFullProperty .Parent .Property }}
{{ $checked := getValue .Values $fullProperty }}
<label for="yes:{{ $fullProperty }}" class="inline-flex items-center mt-3">
<input type="radio"
class="h-5 w-5 text-gray-600"
id="yes:{{ $fullProperty }}"
name="bool:{{ $fullProperty }}"
value="yes"
{{if $checked}}checked="yes"{{end}} />
<span class="ml-2 text-gray-700">Yes</span>
2022-03-22 09:21:55 +01:00
</label>
<label for="no:{{ $fullProperty }}" class="inline-flex items-center mt-3 ml-3">
<input type="radio"
class="h-5 w-5 text-gray-600"
id="no:{{ $fullProperty }}"
name="bool:{{ $fullProperty }}"
value="no"
{{if not $checked}}checked{{end}} />
<span class="ml-2 text-gray-700">No</span>
2022-03-22 09:21:55 +01:00
</label>
{{end}}