(n string)
| 377 | } |
| 378 | |
| 379 | func (h *Handler) Page(n string) http.HandlerFunc { |
| 380 | return h.Web(func(app *App, w http.ResponseWriter, r *http.Request) error { |
| 381 | t, ok := pages[n] |
| 382 | if !ok { |
| 383 | return impart.HTTPError{http.StatusNotFound, "Page not found."} |
| 384 | } |
| 385 | |
| 386 | sp := pageForReq(app, r) |
| 387 | |
| 388 | err := t.ExecuteTemplate(w, "base", sp) |
| 389 | if err != nil { |
| 390 | log.Error("Unable to render page: %v", err) |
| 391 | } |
| 392 | return err |
| 393 | }, UserLevelOptional) |
| 394 | } |
| 395 | |
| 396 | func (h *Handler) WebErrors(f handlerFunc, ul UserLevelFunc) http.HandlerFunc { |
| 397 | return func(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected