Replace toggle buttons with normal check boxes

Normal check boxes have clearer semantics, and play nicer with the
usability provided by default by the web browser.
This commit is contained in:
Harald Eilertsen 2025-07-21 12:17:20 +02:00
parent e699544a06
commit 7d2860f97c

View file

@ -0,0 +1,37 @@
{{* Override the toggle-buttons to turn them back into regilar check boxes.
*
* SPDX-FileCopyrightText: 2025 Eilertsens Kodeknekkeri
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* $field array index:
* .0 field name: name=... for input, id=id_... for input, id=label_... for label, id=help_... for small text
* .1 label text
* .2 checked
* .3 help/info text
* .4 on/off value: (unused in this template)
* .4.0 off
* .4.1 on
* .5 additional operands for html input statement
* .6 label text addition, used for qmc
* css classes used:
* .clearfix, .form_group, .checkbox
* .floatright
* .switchlabel, .onoffswitch-switch
* .required, .code
* .form-control, .form-text, .text-muted
*
*}}
<div id="{{$field.0}}_container" class="clearfix checkbox mb-3">
<input
type="checkbox"
name="{{$field.0}}"
id="id_{{$field.0}}"
value="1"
{{if $field.2}}checked="checked"{{/if}}
{{if $field.5}}{{$field.5}}{{/if}}
>
<label for="id_{{$field.0}}">{{$field.1}}{{if $field.6}}<sup class="required zuiqmid"> {{$field.6}}</sup>{{/if}}</label>
<div class="form-text text-muted">{{$field.3}}</div>
</div>