// Package templates owns the server-rendered HTML for the Phase 1 walking // skeleton. Each *.templ file compiles to a *_templ.go file via `templ // generate`; generated files are gitignored. package templates import ( "backend/internal/auth" "backend/internal/web/ui" ) // Layout is the base HTML shell every page renders inside. The structural // classes, container width (max-w-5xl), horizontal padding, header strip, // footer, and asset references (/static/tailwind.css, /static/htmx.min.js) // are locked by UI-SPEC §Base Layout Contract and CONTEXT D-10 — do NOT // load HTMX from a CDN. // // user is non-nil when the request context carries an authenticated session. // When non-nil, the header renders a Log out POST form (D-22). Auth pages // pass nil since they're gated behind RedirectIfAuthed and never shown to // authed users. // // csrfToken is threaded from the handler via csrf.Token(r) so the logout // form can embed @ui.CSRFField(csrfToken) (AUTH-06, D-14). templ Layout(title string, user *auth.User, csrfToken string) {