avances en tablas

This commit is contained in:
JACS 2026-05-02 21:38:15 -05:00
parent 65f7715b05
commit cc0c524337
7 changed files with 339 additions and 255 deletions

View file

@ -69,21 +69,28 @@ func TablerNavbar(c *core.Context) *core.Response {
return c.Response.Template("tabler_default.html", data)
}
// TablerTables renders a page with table components
// TablerTables renders a page with table components.
// Uses a page-specific struct that embeds TablerPageData and adds the Tables field.
// The template detects tables via hasField and renders them.
func TablerTables(c *core.Context) *core.Response {
data := TablerPageData{
PageTitle: "Tables",
PageDescription: "Table demo page",
ShowTopbar: true,
Sidebar: false,
PageHeader: "Tables",
PagePretitle: "Components",
UserName: "Jane Doe",
UserRole: "Administrator",
NavbarMenu: SampleNavbarMenu(),
TableHeaders: SampleTableHeaders(),
TableRows: SampleTableRows(),
Content: template.HTML(""),
type tablesPageData struct {
TablerPageData
Tables []TableComponent
}
data := tablesPageData{
TablerPageData: TablerPageData{
PageTitle: "Tables",
PageDescription: "Table demo page",
ShowTopbar: true,
Sidebar: false,
PageHeader: "Tables",
PagePretitle: "Components",
UserName: "Jane Doe",
UserRole: "Administrator",
NavbarMenu: SampleNavbarMenu(),
Content: template.HTML(""),
},
Tables: SampleTables(),
}
return c.Response.Template("tabler_tables.html", data)
}