detail table
This commit is contained in:
parent
91455fc972
commit
80520260c9
2 changed files with 40 additions and 1 deletions
|
@ -642,7 +642,8 @@ func Themecontent(c *core.Context) *core.Response {
|
|||
|
||||
// first, include all compoments
|
||||
type templateData struct {
|
||||
ContentTable components.ContentTable
|
||||
ContentTable components.ContentTable
|
||||
ContentTabledetail components.ContentTabledetail
|
||||
}
|
||||
|
||||
// TABLES
|
||||
|
@ -686,6 +687,34 @@ func Themecontent(c *core.Context) *core.Response {
|
|||
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
|
||||
tmplData := templateData{
|
||||
ContentTable: components.ContentTable{
|
||||
|
@ -693,7 +722,14 @@ func Themecontent(c *core.Context) *core.Response {
|
|||
AllTH: allTh,
|
||||
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)
|
||||
|
||||
} else {
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
<div class="row">
|
||||
{{template "content_table" .ContentTable}}
|
||||
</div>
|
||||
<div class="row">
|
||||
{{template "content_tabledetail" .ContentTabledetail}}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{template "page_footer"}}
|
||||
|
|
Loading…
Reference in a new issue