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",
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)
}

View file

@ -16,16 +16,7 @@
<legend>Demos href</legend>
<div class="container d-flex justify-content-between border rounded-3 p-2">
{{range .Hrefs}}
{{template "content_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" .}}
{{template "form_href" .}}
{{end}}
</div>
</fieldset>
@ -35,17 +26,7 @@
<legend>Demos dropdown</legend>
<div class="container d-flex justify-content-between border rounded-3 p-2">
{{range .Dropdowns}}
{{template "content_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" .}}
{{template "form_dropdown" .}}
{{end}}
</div>
</fieldset>