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:
@@ -40,7 +40,7 @@ func AddTicket(db *sql.DB) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
context := helpers.TemplateContext(w, r)
|
||||
context := helpers.TemplateContext(w, r, models.TemplateData{})
|
||||
context["csrfField"] = csrf.TemplateField(r)
|
||||
context["DrawDates"] = drawDates
|
||||
|
||||
@@ -359,7 +359,7 @@ func GetMyTickets(db *sql.DB) http.HandlerFunc {
|
||||
tickets = append(tickets, t)
|
||||
}
|
||||
|
||||
context := helpers.TemplateContext(w, r)
|
||||
context := helpers.TemplateContext(w, r, models.TemplateData{})
|
||||
context["Tickets"] = tickets
|
||||
|
||||
tmpl := template.Must(template.New("").Funcs(helpers.TemplateFuncs()).ParseFiles(
|
||||
|
||||
Reference in New Issue
Block a user