detail table

This commit is contained in:
Zeni Kim 2024-10-27 12:55:12 -05:00
parent 91455fc972
commit 80520260c9
2 changed files with 40 additions and 1 deletions

View file

@ -643,6 +643,7 @@ func Themecontent(c *core.Context) *core.Response {
// first, include all compoments // first, include all compoments
type templateData struct { type templateData struct {
ContentTable components.ContentTable ContentTable components.ContentTable
ContentTabledetail components.ContentTabledetail
} }
// TABLES // TABLES
@ -686,6 +687,34 @@ func Themecontent(c *core.Context) *core.Response {
allTd = append(allTd, vals) allTd = append(allTd, vals)
} }
// for td items in table detail
var allTdetail []components.ContentTabledetailTD
// table detail
var thd components.ContentTabledetailTD
thd.Caption = "Continent"
thd.Value = "Asia"
allTdetail = append(allTdetail, thd)
thd.Caption = "Country"
thd.Value = "South Korea"
allTdetail = append(allTdetail, thd)
thd.Caption = "Capital"
thd.Value = "Seoul"
allTdetail = append(allTdetail, thd)
thd.Caption = "Details"
thd.ValueType = "href" // column type href
thd.Value = components.ContentHref{
Text: "edit",
Link: "#",
}
allTdetail = append(allTdetail, thd)
thd.Caption = "Notifications"
thd.ValueType = "badge" // column type href
thd.Value = components.ContentBadge{
Text: "success",
TypeClass: "success",
}
allTdetail = append(allTdetail, thd)
// now fill data of the components // now fill data of the components
tmplData := templateData{ tmplData := templateData{
ContentTable: components.ContentTable{ ContentTable: components.ContentTable{
@ -693,7 +722,14 @@ func Themecontent(c *core.Context) *core.Response {
AllTH: allTh, AllTH: allTh,
AllTD: allTd, AllTD: allTd,
}, },
ContentTabledetail: components.ContentTabledetail{
ID: "table_demodetail",
Title: "Sample table detail",
//HeadClass: "table-warning",
AllTD: allTdetail,
},
} }
return c.Response.Template("custom_theme_contentpage.html", tmplData) return c.Response.Template("custom_theme_contentpage.html", tmplData)
} else { } else {

View file

@ -8,6 +8,9 @@
<div class="row"> <div class="row">
{{template "content_table" .ContentTable}} {{template "content_table" .ContentTable}}
</div> </div>
<div class="row">
{{template "content_tabledetail" .ContentTabledetail}}
</div>
</fieldset> </fieldset>
</div> </div>
{{template "page_footer"}} {{template "page_footer"}}