Compare commits
4 commits
b9cd82867b
...
789a157571
Author | SHA1 | Date | |
---|---|---|---|
789a157571 | |||
cf8b3bdde7 | |||
7218f26d68 | |||
8eb14bd2da |
2 changed files with 15 additions and 0 deletions
8
template/components/form_switch.go
Normal file
8
template/components/form_switch.go
Normal file
|
@ -0,0 +1,8 @@
|
|||
package components
|
||||
|
||||
type FormSwitch struct {
|
||||
ID string
|
||||
Label string
|
||||
IsChecked bool
|
||||
IsDisabled bool
|
||||
}
|
7
template/components/form_switch.html
Normal file
7
template/components/form_switch.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{{define "form_switch"}}
|
||||
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" name="{{.ID}}" id="{{.ID}}" {{if eq .IsChecked true}} checked{{end}} {{if eq .IsDisabled true}} disabled{{end}}>
|
||||
<label class="form-check-label" for="{{.ID}}">{{.Label}}</label>
|
||||
</div>
|
||||
{{end}}
|
Loading…
Reference in a new issue