Redmage/views/devices/put/nsfw_checkbox.templ

38 lines
770 B
Plaintext

package put
import "fmt"
type NSFWCheckboxData struct {
Checked bool
}
templ NSFWCheckbox(data NSFWCheckboxData) {
<div
x-data={ fmt.Sprintf(`{checked: %t}`, data.Checked) }
class="form-control"
>
<label
class="label cursor-pointer border input input-bordered"
:class="{'input-primary': checked}"
>
<span
class="label-text"
:class="{'text-primary': checked}"
>Allow NSFW Images</span>
<input
type="checkbox"
checked?={ data.Checked }
class="checkbox"
:class="{'checkbox-primary': checked}"
name="nsfw"
value="1"
@change="checked = !checked"
/>
</label>
<span
class="label-text pl-1 mt-2"
:class="{'text-primary': checked}"
>Whether to allow NSFW images for current device.</span>
</div>
}