Files
LazyPM/pkg/web/components/layout.templ
viljarb 1d92041538 modified: web/assets/css/styles.css
modified:   web/components/base/input.templ
	modified:   web/components/base/input_templ.go
	modified:   web/components/base/range.templ
	modified:   web/components/base/range_templ.go
	modified:   web/components/base/select.templ
	modified:   web/components/base/select_templ.go
	modified:   web/components/base/textarea.templ
	modified:   web/components/base/textarea_templ.go
	modified:   web/components/icons.templ
	modified:   web/components/icons_templ.go
	modified:   web/components/issue.templ
	modified:   web/components/issue_templ.go
	modified:   web/components/layout.templ
	modified:   web/components/layout_templ.go
	new file:   web/components/sidebar.templ
	new file:   web/components/sidebar_templ.go
	new file:   web/components/status.templ
	new file:   web/components/status_templ.go
	modified:   web/handler/issues.go
	new file:   web/handler/task.go
	modified:   web/input.css
	deleted:    web/package-lock.json
	deleted:    web/package.json
	modified:   web/routes/layout.templ
	modified:   web/routes/layout_templ.go
	modified:   web/server/routes.go
	modified:   web/server/server.go
	modified:   web/web.go
2026-02-18 20:41:52 +01:00

88 lines
1.8 KiB
Plaintext

package components
templ Layout(props LayoutProps) {
<!DOCTYPE html>
<html lang="en" data-theme="corporate">
<head>
<meta charset="UTF-8"/>
<title>{ props.Title }</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content={ props.Description }/>
@Head(props.Head)
</head>
<body class="min-h-screen bg-base-200 text-base-content flex flex-col">
@Header(props.Header)
<div class="flex flex-1 min-h-0">
@Sidebar(props.Routes)
<main class="flex-1 p-4 bg-base-100 min-h-0 overflow-auto">
{ children... }
</main>
</div>
</body>
</html>
}
type LayoutProps struct {
Title string
Description string
Head HeadProps
Header HeaderProps
Routes []NavRoutes
}
type NavRoutes struct {
Name string
Path string
Icon templ.Component
}
templ Head(props HeadProps) {
for _, link := range props.Links {
<link href={ link.Href } rel={ link.Rel } as={ link.As }/>
}
for _, script := range props.Scripts {
<script src={ script.Src } defer={ script.Defer }></script>
}
}
type HeadProps struct {
Links []Link
Scripts []Script
}
type Link struct {
Href string
Rel string
As string
}
type Script struct {
Src string
Defer bool
}
templ Header(props HeaderProps) {
<header class="navbar bg-primary text-primary-content px-6">
<div class="navbar-start">
<span class="font-semibold mr-5">{ props.Title }</span>
</div>
<div class="navbar-center">
if props.NavbarCenter != nil {
@props.NavbarCenter
}
</div>
<div class="navbar-end">
if props.NavbarEnd != nil {
@props.NavbarEnd
}
</div>
</header>
}
type HeaderProps struct {
Title string
NavbarStart templ.Component
NavbarCenter templ.Component
NavbarEnd templ.Component
}