diff --git a/internal/webui/embed.go b/internal/webui/embed.go index f46374c5..378b29a9 100644 --- a/internal/webui/embed.go +++ b/internal/webui/embed.go @@ -25,22 +25,16 @@ var templatesFS embed.FS // "content", and "scripts" blocks without colliding. var pageTemplates = []string{ "templates/run_detail.html", - "templates/personas.html", "templates/persona_detail.html", "templates/pipeline_detail.html", - "templates/contracts.html", "templates/contract_detail.html", "templates/skills.html", "templates/skill_detail.html", "templates/compose.html", - "templates/issues.html", "templates/issue_detail.html", - "templates/prs.html", "templates/pr_detail.html", - "templates/health.html", "templates/analytics.html", "templates/retros.html", - "templates/notfound.html", "templates/compare.html", "templates/webhooks.html", "templates/webhook_detail.html", @@ -62,6 +56,12 @@ var standalonePageTemplates = []string{ "templates/proposals/detail.html", "templates/runs.html", "templates/pipelines.html", + "templates/issues.html", + "templates/prs.html", + "templates/health.html", + "templates/contracts.html", + "templates/personas.html", + "templates/notfound.html", } // parseTemplates parses all embedded HTML templates using a clone-per-page diff --git a/internal/webui/handlers_contracts.go b/internal/webui/handlers_contracts.go index b48590f5..0ead194a 100644 --- a/internal/webui/handlers_contracts.go +++ b/internal/webui/handlers_contracts.go @@ -88,7 +88,7 @@ func (s *Server) handleContractsPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/contracts.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/contracts.html"].Execute(w, data); err != nil { http.Error(w, "template error: "+err.Error(), http.StatusInternalServerError) } } diff --git a/internal/webui/handlers_health.go b/internal/webui/handlers_health.go index 122f053c..074bf4cf 100644 --- a/internal/webui/handlers_health.go +++ b/internal/webui/handlers_health.go @@ -19,7 +19,7 @@ func (s *Server) handleHealthPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/health.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/health.html"].Execute(w, data); err != nil { http.Error(w, "template error: "+err.Error(), http.StatusInternalServerError) } } diff --git a/internal/webui/handlers_issues.go b/internal/webui/handlers_issues.go index 91527a67..a2538aac 100644 --- a/internal/webui/handlers_issues.go +++ b/internal/webui/handlers_issues.go @@ -31,7 +31,7 @@ func (s *Server) handleIssuesPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/issues.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/issues.html"].Execute(w, data); err != nil { http.Error(w, "template error: "+err.Error(), http.StatusInternalServerError) } } diff --git a/internal/webui/handlers_personas.go b/internal/webui/handlers_personas.go index 7fc47643..0e7768a5 100644 --- a/internal/webui/handlers_personas.go +++ b/internal/webui/handlers_personas.go @@ -26,7 +26,7 @@ func (s *Server) handlePersonasPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/personas.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/personas.html"].Execute(w, data); err != nil { http.Error(w, "template error: "+err.Error(), http.StatusInternalServerError) } } diff --git a/internal/webui/handlers_prs.go b/internal/webui/handlers_prs.go index 1db79f54..c468efc3 100644 --- a/internal/webui/handlers_prs.go +++ b/internal/webui/handlers_prs.go @@ -33,7 +33,7 @@ func (s *Server) handlePRsPage(w http.ResponseWriter, r *http.Request) { } w.Header().Set("Content-Type", "text/html; charset=utf-8") - if err := s.assets.templates["templates/prs.html"].ExecuteTemplate(w, "templates/layout.html", data); err != nil { + if err := s.assets.templates["templates/prs.html"].Execute(w, data); err != nil { log.Printf("[webui] template error rendering prs page: %v", err) http.Error(w, "template error", http.StatusInternalServerError) } diff --git a/internal/webui/routes.go b/internal/webui/routes.go index aed83db5..dc983b40 100644 --- a/internal/webui/routes.go +++ b/internal/webui/routes.go @@ -115,6 +115,6 @@ func (s *Server) handleNotFound(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotFound) tmpl := s.assets.templates["templates/notfound.html"] if tmpl != nil { - _ = tmpl.ExecuteTemplate(w, "templates/layout.html", nil) + _ = tmpl.Execute(w, nil) } } diff --git a/internal/webui/templates/contracts.html b/internal/webui/templates/contracts.html index 4fc5213f..ad08edab 100644 --- a/internal/webui/templates/contracts.html +++ b/internal/webui/templates/contracts.html @@ -1,43 +1,79 @@ -{{define "title"}}Contracts · Wave{{end}} -{{define "content"}} -