diff --git a/controllers/themedemo.go b/controllers/themedemo.go index 1373052..6b9e35c 100644 --- a/controllers/themedemo.go +++ b/controllers/themedemo.go @@ -134,7 +134,6 @@ func Themeform(c *core.Context) *core.Response { ID: "email", Label: "Email", Type: "email", - IsRequired: true, Placeholder: "Enter your email address", }, FormButton: components.FormButton{ @@ -183,10 +182,8 @@ func ThemeElements(c *core.Context) *core.Response { if TemplateEnable { type templateData struct { Buttons []components.FormButton - Hrefs []components.ContentHref - Badges []components.ContentBadge - Dropdowns []components.ContentDropdown - Lists []components.ContentList + Hrefs []components.FormHref + Dropdowns []components.FormDropdown Menus []components.PageNav } buttons := []components.FormButton{ @@ -264,7 +261,7 @@ func ThemeElements(c *core.Context) *core.Response { TypeClass: "outline-dark", }, } - hrefs := []components.ContentHref{ + hrefs := []components.FormHref{ { Text: "href", Link: "#", @@ -302,65 +299,11 @@ func ThemeElements(c *core.Context) *core.Response { IsDisabled: true, }, } - badges := []components.ContentBadge{ - { - Text: "primary", - TypeClass: "primary", - }, - { - Text: "secondary", - TypeClass: "secondary", - }, - { - Text: "success", - TypeClass: "success", - }, - { - Text: "danger", - TypeClass: "danger", - }, - { - Text: "warning", - TypeClass: "warning", - }, - { - Text: "info", - TypeClass: "info", - }, - { - Text: "light", - TypeClass: "light", - }, - { - Text: "dark", - TypeClass: "dark", - }, - { - Text: "outline", - TypeClass: "primary", - IsOutline: true, - }, - { - Text: "outline", - TypeClass: "success", - IsOutline: true, - }, - { - Text: "outline", - TypeClass: "danger", - IsOutline: true, - }, - { - Text: "outline", - TypeClass: "warning", - IsOutline: true, - }, - } - dropdowns := []components.ContentDropdown{ + dropdowns := []components.FormDropdown{ // dropdown { Label: "dropdown", - Items: []components.ContentDropdownItem{ + Items: []components.FormDropdownItem{ { Text: "item ", Link: "#", @@ -376,7 +319,7 @@ func ThemeElements(c *core.Context) *core.Response { { Label: "primary", TypeClass: "primary", - Items: []components.ContentDropdownItem{ + Items: []components.FormDropdownItem{ { Text: "item ", Link: "#", @@ -397,7 +340,7 @@ func ThemeElements(c *core.Context) *core.Response { { Label: "outline", TypeClass: "outline-primary", - Items: []components.ContentDropdownItem{ + Items: []components.FormDropdownItem{ { Text: "item ", Link: "#", @@ -412,59 +355,7 @@ func ThemeElements(c *core.Context) *core.Response { // items }, } - list := []components.ContentList{ - // basic list - { - Items: []components.ContentListItem{ - { - Text: "item 1", - }, - { - Text: "item 2", - EndElement: "end text", - }, - { - Text: "item disabled", - IsDisabled: true, - }, - }, - }, - // description list - { - Items: []components.ContentListItem{ - { - Text: "item 1", - Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. ", - }, - { - Text: "item 2", - Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", - }, - { - Text: "item disabled", - Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", - IsDisabled: true, - }, - }, - }, - // list with class - { - Items: []components.ContentListItem{ - { - Text: "class primary", - TypeClass: "primary", - }, - { - Text: "class success", - TypeClass: "success", - }, - { - Text: "class danger", - TypeClass: "danger", - }, - }, - }, - } + menus := []components.PageNav{ // nav { @@ -614,9 +505,7 @@ func ThemeElements(c *core.Context) *core.Response { tmplData := templateData{ Buttons: buttons, Hrefs: hrefs, - Badges: badges, Dropdowns: dropdowns, - Lists: list, Menus: menus, } return c.Response.Template("custom_theme_elements.html", tmplData) @@ -656,12 +545,6 @@ func Themecontent(c *core.Context) *core.Response { th.ID = "ba" th.Value = "Column heading 3" allTh = append(allTh, th) - th.Value = "Column badge" - th.ValueType = "badge" // column type badge - allTh = append(allTh, th) - th.Value = "Column action" - th.ValueType = "href" // column type href - allTh = append(allTh, th) // for td items var allTd [][]components.ContentTableTD @@ -669,20 +552,10 @@ func Themecontent(c *core.Context) *core.Response { // rows for i := 1; i <= 10; i++ { vals := make([]components.ContentTableTD, len(allTh)) - for b := 0; b < len(allTh)-2; b++ { + for b := 0; b < len(allTh); b++ { vals[b].Value = fmt.Sprintf("%s%d%d", "TD data: ", i, b) vals[b].ID = fmt.Sprintf("%s%d%d", "idtd_", i, b) } - // column badge - vals[len(allTh)-2].Value = components.ContentBadge{ - Text: "success", - TypeClass: "success", - } - // last column href - vals[len(allTh)-1].Value = components.ContentHref{ - Text: "edit", - Link: "#", - } allTd = append(allTd, vals) } diff --git a/storage/templates/custom_theme_elements.html b/storage/templates/custom_theme_elements.html index fbe2d52..9135431 100644 --- a/storage/templates/custom_theme_elements.html +++ b/storage/templates/custom_theme_elements.html @@ -16,16 +16,7 @@ Demos href
{{range .Hrefs}} - {{template "content_href" .}} - {{end}} -
- - -
- Demos Badges -
- {{range .Badges}} - {{template "content_badge" .}} + {{template "form_href" .}} {{end}}
@@ -35,17 +26,7 @@ Demos dropdown
{{range .Dropdowns}} - {{template "content_dropdown" .}} - {{end}} -
- - - -
- Demos List -
- {{range .Lists}} - {{template "content_list" .}} + {{template "form_dropdown" .}} {{end}}