diff --git a/template/components/form_checkbox.go b/template/components/form_checkbox.go new file mode 100644 index 0000000..819da82 --- /dev/null +++ b/template/components/form_checkbox.go @@ -0,0 +1,14 @@ +package components + +type FormCheckbox struct { + Label string + AllCheckbox []FormCheckboxItem +} + +type FormCheckboxItem struct { + ID string + Name string + Value string + Label string + IsChecked bool +} diff --git a/template/components/form_checkbox.html b/template/components/form_checkbox.html new file mode 100644 index 0000000..9a8d845 --- /dev/null +++ b/template/components/form_checkbox.html @@ -0,0 +1,11 @@ +{{define "form_checkbox"}} +
+ + {{range $options := .AllCheckbox}} +
+ + +
+ {{end}} +
+{{end}} \ No newline at end of file diff --git a/template/components/form_radio.go b/template/components/form_radio.go new file mode 100644 index 0000000..e8e923c --- /dev/null +++ b/template/components/form_radio.go @@ -0,0 +1,15 @@ +package components + +type FormRadio struct { + Label string + AllRadios []FormRadioItem +} + +type FormRadioItem struct { + ID string + Name string + Value string + Label string + IsDisabled bool + IsChecked bool +} diff --git a/template/components/form_radio.html b/template/components/form_radio.html new file mode 100644 index 0000000..a0c26cd --- /dev/null +++ b/template/components/form_radio.html @@ -0,0 +1,11 @@ +{{define "form_radio"}} +
+ + {{range $options := .AllRadios}} +
+ + +
+ {{end}} +
+{{end}} \ No newline at end of file diff --git a/template/components/form_select.go b/template/components/form_select.go new file mode 100644 index 0000000..db94fe3 --- /dev/null +++ b/template/components/form_select.go @@ -0,0 +1,13 @@ +package components + +type FormSelect struct { + ID string + SelectedOption FormSelectOption + Label string + AllOptions []FormSelectOption +} + +type FormSelectOption struct { + Value string + Caption string +} diff --git a/template/components/form_select.html b/template/components/form_select.html new file mode 100644 index 0000000..6317e6b --- /dev/null +++ b/template/components/form_select.html @@ -0,0 +1,10 @@ +{{define "form_select"}} +
+ + +
+{{end}} \ No newline at end of file diff --git a/template/components/form_textarea.go b/template/components/form_textarea.go new file mode 100644 index 0000000..8fbaf51 --- /dev/null +++ b/template/components/form_textarea.go @@ -0,0 +1,7 @@ +package components + +type FormTextarea struct { + ID string + Label string + AllOptions []FormSelectOption +} diff --git a/template/components/form_textarea.html b/template/components/form_textarea.html new file mode 100644 index 0000000..5372a42 --- /dev/null +++ b/template/components/form_textarea.html @@ -0,0 +1,6 @@ +{{define "form_textarea"}} +
+ + +
+{{end}} \ No newline at end of file