Cleanup: Finalize template context integration and remove legacy code
- Replaced legacy TemplateContext calls with structured TemplateData usage - Removed unused variables and redundant storage calls in notifications handler - Ensured consistent use of BuildTemplateData across user-facing handlers - Resolved all compile-time errors from refactor - Ready for runtime testing and further layout integration
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"synlotto-website/helpers"
|
||||
"synlotto-website/models"
|
||||
)
|
||||
|
||||
func AddPrizesHandler(db *sql.DB) http.HandlerFunc {
|
||||
@@ -16,7 +17,7 @@ func AddPrizesHandler(db *sql.DB) http.HandlerFunc {
|
||||
"templates/layout.html",
|
||||
"templates/admin/draws/prizes/add_prizes.html",
|
||||
))
|
||||
tmpl.ExecuteTemplate(w, "layout", helpers.TemplateContext(w, r))
|
||||
tmpl.ExecuteTemplate(w, "layout", helpers.TemplateContext(w, r, models.TemplateData{}))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -50,7 +51,7 @@ func ModifyPrizesHandler(db *sql.DB) http.HandlerFunc {
|
||||
"templates/layout.html",
|
||||
"templates/admin/draws/prizes/modify_prizes.html",
|
||||
))
|
||||
tmpl.ExecuteTemplate(w, "layout", helpers.TemplateContext(w, r))
|
||||
tmpl.ExecuteTemplate(w, "layout", helpers.TemplateContext(w, r, models.TemplateData{}))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user