All checks were successful
Deploy to K8s / deploy (push) Successful in 7s
Stand up the Go-native HTML frontend foundation: - base.tmpl layout + nav/footer partials (three-tier nav, active-link highlighting) - terminal-green-on-black theme extracted to static/css/app.css (served via embed.FS) - HTMLHandler with stub pages for all five routes; / redirects to /adults - NewRenderer parses per-page template sets at startup so parse failures abort boot - Smoke test: each route returns 200 text/html with exactly one class="active" link Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package web
|
|
|
|
import "net/http"
|
|
|
|
// HTMLHandler serves the Go-native HTML frontend.
|
|
type HTMLHandler struct {
|
|
renderer *Renderer
|
|
build BuildInfo
|
|
}
|
|
|
|
// NewHTMLHandler constructs an HTMLHandler.
|
|
func NewHTMLHandler(r *Renderer, b BuildInfo) *HTMLHandler {
|
|
return &HTMLHandler{renderer: r, build: b}
|
|
}
|
|
|
|
func (h *HTMLHandler) ServeAdults(w http.ResponseWriter, r *http.Request) {
|
|
h.renderer.Render(w, "adults", PageData{Active: "adults", Build: h.build})
|
|
}
|
|
|
|
func (h *HTMLHandler) ServeJuniors(w http.ResponseWriter, r *http.Request) {
|
|
h.renderer.Render(w, "juniors", PageData{Active: "juniors", Build: h.build})
|
|
}
|
|
|
|
func (h *HTMLHandler) ServePayments(w http.ResponseWriter, r *http.Request) {
|
|
h.renderer.Render(w, "payments", PageData{Active: "payments", Build: h.build})
|
|
}
|
|
|
|
func (h *HTMLHandler) ServeSync(w http.ResponseWriter, r *http.Request) {
|
|
h.renderer.Render(w, "sync", PageData{Active: "sync", Build: h.build})
|
|
}
|
|
|
|
func (h *HTMLHandler) ServeFlushCache(w http.ResponseWriter, r *http.Request) {
|
|
h.renderer.Render(w, "flush_cache", PageData{Active: "flush", Build: h.build})
|
|
}
|