More layout and customisations.

This commit is contained in:
2025-04-01 10:19:56 +01:00
parent aaf90b55da
commit 5aaddf16f1
8 changed files with 218 additions and 126 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/gorilla/csrf"
)
// ToDo this should not be in draw for home!
func Home(db *sql.DB) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
rows, err := db.Query(`
@@ -50,8 +51,9 @@ func Home(db *sql.DB) http.HandlerFunc {
context := helpers.TemplateContext(w, r)
context["Data"] = results
tmpl := template.Must(template.ParseFiles(
tmpl := template.Must(template.New("").Funcs(helpers.TemplateFuncs()).ParseFiles(
"templates/layout.html",
"templates/topbar.html",
"templates/index.html",
))
@@ -69,6 +71,7 @@ func NewDraw(w http.ResponseWriter, r *http.Request) {
tmpl := template.Must(template.ParseFiles(
"templates/layout.html",
"templates/topbar.html",
"templates/new_draw.html",
))