diff --git a/handlers.go b/handlers.go index e4ee40f..7fcf28e 100644 --- a/handlers.go +++ b/handlers.go @@ -776,3 +776,11 @@ func (s *Server) handleDeleteSlot(w http.ResponseWriter, r *http.Request) { } pageTmpl["slots"].ExecuteTemplate(w, "slots-inner", data) } + +func (s *Server) handlePrivacy(w http.ResponseWriter, r *http.Request) { + pageTmpl["privacy"].ExecuteTemplate(w, "layout", nil) +} + +func (s *Server) handleTerms(w http.ResponseWriter, r *http.Request) { + pageTmpl["terms"].ExecuteTemplate(w, "layout", nil) +} diff --git a/main.go b/main.go index 2af57e6..4fe15f3 100644 --- a/main.go +++ b/main.go @@ -124,7 +124,7 @@ func main() { // Parse each page with layout + shared partials pageTmpl = make(map[string]*template.Template) shared := []string{"templates/layout.html", "templates/slots.html"} - for _, page := range []string{"home", "event", "login", "dashboard", "name"} { + for _, page := range []string{"home", "event", "login", "dashboard", "name", "privacy", "terms"} { files := append([]string{"templates/" + page + ".html"}, shared...) pageTmpl[page] = template.Must( template.New("").Funcs(funcMap).ParseFS(templateFS, files...), @@ -172,6 +172,10 @@ func main() { }) } + // Legal + r.Get("/privacy", srv.handlePrivacy) + r.Get("/terms", srv.handleTerms) + // Home / create event r.Get("/", srv.handleHome) if features.Auth { diff --git a/templates/layout.html b/templates/layout.html index 56f62d0..16bf62d 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -477,5 +477,10 @@ document.body.addEventListener('closeModal', function() { });
+