{{/* Shared building blocks used across pages. */}} {{define "sidebar"}} {{end}} {{/* Page header: title, optional subtitle and a slot for actions. */}} {{define "pageheader"}}

{{.Title}}

{{if .Subtitle}}

{{.Subtitle}}

{{end}}
{{if .Actions}}
{{.Actions}}
{{end}}
{{end}} {{/* A statistic tile. Pass: Label, Value, Icon, Sub, Tone. */}} {{define "stat"}}
{{.Label}}
{{if .Icon}}{{end}}
{{.Value}}
{{if .Sub}}
{{.Sub}}
{{end}}
{{end}} {{/* Empty state. Pass: Icon, Title, Message, optional Action (safe HTML). */}} {{define "empty"}}

{{.Title}}

{{.Message}}

{{if .Action}}
{{.Action}}
{{end}}
{{end}} {{/* Pagination. Pass: P (pagination struct), Q (url.Values). */}} {{define "pagination"}} {{$p := .P}}{{$q := .Q}} {{if gt $p.Pages 1}} {{else if gt $p.Total 0}}
{{num $p.Total}} result{{if ne $p.Total 1}}s{{end}}
{{end}} {{end}} {{/* A destructive submit button that opens the shared confirmation modal. Pass: Action, CSRF, Label, Message, optional Icon, Class, ReturnTo. */}} {{define "confirmform"}}
{{if .ReturnTo}}{{end}} {{range $k, $v := .Fields}}{{end}}
{{end}} {{/* A plain post button with no confirmation. Same fields as confirmform. */}} {{define "postform"}}
{{if .ReturnTo}}{{end}} {{range $k, $v := .Fields}}{{end}}
{{end}} {{/* Settings sub-navigation. Pass the active key as .Subnav. */}} {{define "settingsnav"}} {{end}} {{/* Marks a field that needs a restart to take effect. */}} {{define "restartbadge"}} restart required {{end}}