summaryrefslogtreecommitdiffstats
path: root/cmd/web/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/handlers.go')
-rw-r--r--cmd/web/handlers.go23
1 files changed, 3 insertions, 20 deletions
diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go
index 6901661..4d90469 100644
--- a/cmd/web/handlers.go
+++ b/cmd/web/handlers.go
@@ -34,32 +34,15 @@ func (app *application) listOperations(w http.ResponseWriter, r *http.Request) {
}
}
- files := []string{
- "./ui/html/base.tmpl.html",
- "./ui/html/pages/operations/list.tmpl.html",
- "./ui/html/partials/nav.tmpl.html",
- }
-
- ts, err := template.ParseFiles(files...)
- if err != nil {
- app.serverError(w, r, err) // Use the serverError() helper
- return
- }
-
- data := operationsTemplateData{
+ app.render(w, r, http.StatusOK, "operations_list.tmpl.html", templateData{
Operations: newOps,
- }
-
- err = ts.ExecuteTemplate(w, "base", data)
- if err != nil {
- app.serverError(w, r, err) // Use the serverError() helper
- }
+ })
}
func (app *application) listOrganisations(w http.ResponseWriter, r *http.Request) {
files := []string{
"./ui/html/base.tmpl.html",
- "./ui/html/pages/organisations/list.tmpl.html",
+ "./ui/html/pages/organisations_list.tmpl.html",
"./ui/html/partials/nav.tmpl.html",
}