This commit is contained in:
lbenedar
2026-03-05 17:46:26 +03:00
parent c2883b9916
commit b50cd42f4f
8 changed files with 70 additions and 30 deletions

View File

@@ -14,6 +14,7 @@ type templateData struct {
Snippet *models.Snippet
Snippets []*models.Snippet
Form any
Flash string
}
func humanDate(t time.Time) string {
@@ -27,6 +28,7 @@ var functions = template.FuncMap{
func (app *application) newTemplateData(r *http.Request) *templateData {
return &templateData{
CurrentYear: time.Now().Year(),
Flash: app.sessionManager.PopString(r.Context(), "flash"),
}
}