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:
@@ -2,6 +2,7 @@ package helpers
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
@@ -69,6 +70,7 @@ func LoadTemplateFiles(name string, files ...string) *template.Template {
|
||||
}
|
||||
all := append(shared, files...)
|
||||
|
||||
log.Printf("📄 Loading templates: %v", all)
|
||||
return template.Must(template.New(name).Funcs(TemplateFuncs()).ParseFiles(all...))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user