- Introduced models.TemplateData for shared user/context state - Moved context construction logic into handlers/template_context.go - Simplified helpers.TemplateContext to accept structured data - Restored and organized template helper functions - Updated affected handlers (main.go, draw_handler.go, notifications.go) - Improved scalability and separation of concerns in template rendering
11 lines
203 B
Go
11 lines
203 B
Go
package models
|
|
|
|
type TemplateData struct {
|
|
User *User
|
|
IsAdmin bool
|
|
NotificationCount int
|
|
Notifications []Notification
|
|
MessageCount int
|
|
Messages []Message
|
|
}
|