- Add shared ui_*.html parts (pageHeader, sectionHeader, statusBadge, emptyState) parsed into every template set - Add anatomy lint rules with a shrinking allowlist and screen-coverage check - Add make screens capture harness with contact sheets and baseline diff - Compose member and FedWiki regions server-side so pages arrive complete - Rebuild Domains and Integrations on the parts as pilots
28 lines
1.0 KiB
Go
28 lines
1.0 KiB
Go
package web
|
|
|
|
import (
|
|
"html/template"
|
|
"io/fs"
|
|
|
|
"git.coopcloud.tech/wiki-cafe/member-console/internal/config"
|
|
"git.coopcloud.tech/wiki-cafe/member-console/internal/embeds"
|
|
)
|
|
|
|
// ParseUIPartials parses the shared application shell
|
|
// (templates/partials/shell_*.html) and the page-anatomy parts
|
|
// (templates/partials/ui_*.html) into t, and installs the one template
|
|
// function they need. Every template set that renders a page or a partial
|
|
// calls it once, so the parts are defined by name (pageHeader,
|
|
// sectionHeader, statusBadge, emptyState, shell_topbar.html,
|
|
// shell_rail_member.html) in every set and no set keeps its own list
|
|
// (docs/design-system.md §6 "Page anatomy"; spec page-anatomy "Every page
|
|
// is built from the shared parts").
|
|
func ParseUIPartials(t *template.Template) (*template.Template, error) {
|
|
sub, err := fs.Sub(embeds.Templates, "templates")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
t = t.Funcs(template.FuncMap{"deploymentName": config.DeploymentName})
|
|
return t.ParseFS(sub, "partials/shell_*.html", "partials/ui_*.html")
|
|
}
|