Compare commits

..

No commits in common. "384f25d2206bce83279767c628eb4d1c87bd673e" and "04666cf1abbe9b19392b723f179c0fd06ab91fe8" have entirely different histories.

2 changed files with 11 additions and 157 deletions

View file

@ -134,7 +134,6 @@ func Themeform(c *core.Context) *core.Response {
ID: "email", ID: "email",
Label: "Email", Label: "Email",
Type: "email", Type: "email",
IsRequired: true,
Placeholder: "Enter your email address", Placeholder: "Enter your email address",
}, },
FormButton: components.FormButton{ FormButton: components.FormButton{
@ -183,10 +182,8 @@ func ThemeElements(c *core.Context) *core.Response {
if TemplateEnable { if TemplateEnable {
type templateData struct { type templateData struct {
Buttons []components.FormButton Buttons []components.FormButton
Hrefs []components.ContentHref Hrefs []components.FormHref
Badges []components.ContentBadge Dropdowns []components.FormDropdown
Dropdowns []components.ContentDropdown
Lists []components.ContentList
Menus []components.PageNav Menus []components.PageNav
} }
buttons := []components.FormButton{ buttons := []components.FormButton{
@ -264,7 +261,7 @@ func ThemeElements(c *core.Context) *core.Response {
TypeClass: "outline-dark", TypeClass: "outline-dark",
}, },
} }
hrefs := []components.ContentHref{ hrefs := []components.FormHref{
{ {
Text: "href", Text: "href",
Link: "#", Link: "#",
@ -302,65 +299,11 @@ func ThemeElements(c *core.Context) *core.Response {
IsDisabled: true, IsDisabled: true,
}, },
} }
badges := []components.ContentBadge{ dropdowns := []components.FormDropdown{
{
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{
// dropdown // dropdown
{ {
Label: "dropdown", Label: "dropdown",
Items: []components.ContentDropdownItem{ Items: []components.FormDropdownItem{
{ {
Text: "item ", Text: "item ",
Link: "#", Link: "#",
@ -376,7 +319,7 @@ func ThemeElements(c *core.Context) *core.Response {
{ {
Label: "primary", Label: "primary",
TypeClass: "primary", TypeClass: "primary",
Items: []components.ContentDropdownItem{ Items: []components.FormDropdownItem{
{ {
Text: "item ", Text: "item ",
Link: "#", Link: "#",
@ -397,7 +340,7 @@ func ThemeElements(c *core.Context) *core.Response {
{ {
Label: "outline", Label: "outline",
TypeClass: "outline-primary", TypeClass: "outline-primary",
Items: []components.ContentDropdownItem{ Items: []components.FormDropdownItem{
{ {
Text: "item ", Text: "item ",
Link: "#", Link: "#",
@ -412,59 +355,7 @@ func ThemeElements(c *core.Context) *core.Response {
// items // 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{ menus := []components.PageNav{
// nav // nav
{ {
@ -614,9 +505,7 @@ func ThemeElements(c *core.Context) *core.Response {
tmplData := templateData{ tmplData := templateData{
Buttons: buttons, Buttons: buttons,
Hrefs: hrefs, Hrefs: hrefs,
Badges: badges,
Dropdowns: dropdowns, Dropdowns: dropdowns,
Lists: list,
Menus: menus, Menus: menus,
} }
return c.Response.Template("custom_theme_elements.html", tmplData) return c.Response.Template("custom_theme_elements.html", tmplData)
@ -656,12 +545,6 @@ func Themecontent(c *core.Context) *core.Response {
th.ID = "ba" th.ID = "ba"
th.Value = "Column heading 3" th.Value = "Column heading 3"
allTh = append(allTh, th) 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 // for td items
var allTd [][]components.ContentTableTD var allTd [][]components.ContentTableTD
@ -669,20 +552,10 @@ func Themecontent(c *core.Context) *core.Response {
// rows // rows
for i := 1; i <= 10; i++ { for i := 1; i <= 10; i++ {
vals := make([]components.ContentTableTD, len(allTh)) 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].Value = fmt.Sprintf("%s%d%d", "TD data: ", i, b)
vals[b].ID = fmt.Sprintf("%s%d%d", "idtd_", 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) allTd = append(allTd, vals)
} }

View file

@ -16,16 +16,7 @@
<legend>Demos href</legend> <legend>Demos href</legend>
<div class="container d-flex justify-content-between border rounded-3 p-2"> <div class="container d-flex justify-content-between border rounded-3 p-2">
{{range .Hrefs}} {{range .Hrefs}}
{{template "content_href" .}} {{template "form_href" .}}
{{end}}
</div>
</fieldset>
<fieldset class="mb-3">
<legend>Demos Badges</legend>
<div class="container d-flex justify-content-between border rounded-3 p-2">
{{range .Badges}}
{{template "content_badge" .}}
{{end}} {{end}}
</div> </div>
</fieldset> </fieldset>
@ -35,17 +26,7 @@
<legend>Demos dropdown</legend> <legend>Demos dropdown</legend>
<div class="container d-flex justify-content-between border rounded-3 p-2"> <div class="container d-flex justify-content-between border rounded-3 p-2">
{{range .Dropdowns}} {{range .Dropdowns}}
{{template "content_dropdown" .}} {{template "form_dropdown" .}}
{{end}}
</div>
</fieldset>
<fieldset class="mb-3">
<legend>Demos List</legend>
<div class="container d-flex justify-content-between border rounded-3 p-2">
{{range .Lists}}
{{template "content_list" .}}
{{end}} {{end}}
</div> </div>
</fieldset> </fieldset>