Refactor: Recover middleware now uses RenderError + add full notifications view

- Replaced http.Error with helpers.RenderError in Recover middleware
- Custom 500.html now rendered with layout and topbar on panic
- RenderError gracefully checks template existence and falls back to plain response
- Added /account/notifications full view page (index)
- Linked "Back to notifications" from notification read view
- Fixed typo in template path for notifications/index.html
- Improved layout consistency across error and account pages
This commit is contained in:
2025-04-02 09:54:20 +01:00
parent 2498b33a9c
commit ab1d9abc72
6 changed files with 49 additions and 22 deletions

View File

@@ -68,6 +68,7 @@ func setupAccountRoutes(mux *http.ServeMux, db *sql.DB) {
mux.HandleFunc("/signup", middleware.Auth(false)(handlers.Signup))
mux.HandleFunc("/account/tickets/add_ticket", handlers.AddTicket(db))
mux.HandleFunc("/account/tickets/my_tickets", handlers.GetMyTickets(db))
mux.HandleFunc("/account/notifications", middleware.Auth(true)(handlers.NotificationsHandler(db)))
mux.HandleFunc("/account/notifications/read", middleware.Auth(true)(handlers.MarkNotificationReadHandler(db)))
}