diff --git a/controllers/themedemo.go b/controllers/themedemo.go index bbde3c6..696862b 100644 --- a/controllers/themedemo.go +++ b/controllers/themedemo.go @@ -646,8 +646,37 @@ func Themecontent(c *core.Context) *core.Response { ContentTable components.ContentTable ContentTabledetail components.ContentTabledetail ContentGraph components.ContentGraph + FieldText components.FormInput + FormSelectCityM components.FormSelect } + // for select options + var allOptions []components.FormSelectOption + var option components.FormSelectOption + option.Value = "ch" + option.Caption = "China" + allOptions = append(allOptions, option) + option.Value = "ba" + option.Caption = "Buenos Aires" + allOptions = append(allOptions, option) + option.Value = "fr" + option.Caption = "France" + selectedOption := option + allOptions = append(allOptions, option) + option.Value = "kr" + option.Caption = "Korea" + allOptions = append(allOptions, option) + + // for custom attributes in form + var customAtt []components.CustomAtt + var attribute components.CustomAtt + attribute.AttName = "code" + attribute.AttValue = "five" + customAtt = append(customAtt, attribute) + attribute.AttName = "mytag" + attribute.AttValue = "My value" + customAtt = append(customAtt, attribute) + // TABLES // for th head var allTh []components.ContentTableTH @@ -725,6 +754,21 @@ func Themecontent(c *core.Context) *core.Response { // now fill data of the components tmplData := templateData{ + FormSelectCityM: components.FormSelect{ + ID: "city", + Label: "Select city", + AllOptions: allOptions, + SelectedOption: selectedOption, + IsMultiple: true, + }, + FieldText: components.FormInput{ + ID: "text", + Label: "Name", + Type: "text", + Hint: "This is sample hint", + Placeholder: "Enter your name", + CustomAtt: customAtt, + }, ContentTable: components.ContentTable{ ID: "table_demo", AllTH: allTh, diff --git a/storage/templates/custom_theme_contentpage.html b/storage/templates/custom_theme_contentpage.html index 67b35f9..1024f56 100644 --- a/storage/templates/custom_theme_contentpage.html +++ b/storage/templates/custom_theme_contentpage.html @@ -12,6 +12,9 @@

Pie chart

{{template "content_graph" .ContentGraph}} +
+ {{template "form_input" .FieldText}} + {{template "form_select" .FormSelectCityM}}
{{template "content_tabledetail" .ContentTabledetail}}