Files
LazyPM/pkg/web/routes/layout.templ
Ine Maria Nilssen Aanonsen d1ef4e9491 READ ISSUES - WEB
2026-02-23 13:51:42 +01:00

45 lines
1.5 KiB
Plaintext

package routes
import "github.com/LazyBachelor/LazyPM/pkg/web/components"
type BaseLayoutProps struct {
SearchQuery string
}
func buildLayoutProps(searchQuery string) components.LayoutProps {
return components.LayoutProps{
Title: "Beads Test Application",
Description: "A sample application using Beads storage service",
Head: components.HeadProps{
Links: []components.Link{
{Href: "/assets/css/styles.css", Rel: "preload", As: "style"},
{Href: "/assets/css/styles.css", Rel: "stylesheet"},
{Href: "/assets/manifest.json", Rel: "manifest"},
},
Scripts: []components.Script{
{Src: "/assets/js/htmx.min.js", Defer: true},
{Src: "/assets/js/ajax.min.js", Defer: true},
},
},
Routes: []components.NavRoutes{
{Name: "Dashboard", Path: "/", Icon: components.IconDashboard()},
{Name: "Issues", Path: "/", Icon: components.IconIssues()},
{Name: "Agile Board", Path: "/board", Icon: components.IconAgileBoard()},
{Name: "Backlog", Path: "/backlog", Icon: components.IconBacklog()},
{Name: "Reports", Path: "/reports", Icon: components.IconReports()},
{Name: "Settings", Path: "/settings", Icon: components.IconSettings()},
},
Header: components.HeaderProps{
Title: "LazyPM Dashboard",
NavbarCenter: components.SearchForm(searchQuery),
NavbarEnd: components.Status(),
},
}
}
templ BaseLayout(props BaseLayoutProps) {
@components.Layout(buildLayoutProps(props.SearchQuery)) {
{ children... }
}
}