summaryrefslogtreecommitdiff
path: root/internal/handlers/handlers.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-02-07 15:42:07 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-02-07 15:42:07 -1000
commitd793e16f336189d38a9d43310713dd13e3b7c438 (patch)
treeb1e53d42069619912e683ddd1a58ed67b1873190 /internal/handlers/handlers.go
parent0620afc98fdc0f764e82807bb0090b78618ddb1d (diff)
Add build version footer, deploy ldflags, template test helper, and logs script
- Display build commit hash in unobtrusive footer overlay - Inject buildCommit/buildTime via ldflags in deploy.sh - Add assertTemplateContains test helper, refactor existing template tests - Add scripts/logs for fetching production journalctl via SSH Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/handlers.go')
-rw-r--r--internal/handlers/handlers.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go
index 650eeaa..226f117 100644
--- a/internal/handlers/handlers.go
+++ b/internal/handlers/handlers.go
@@ -29,10 +29,11 @@ type Handler struct {
googleTasksClient api.GoogleTasksAPI
config *config.Config
renderer Renderer
+ BuildVersion string
}
// New creates a new Handler instance
-func New(s *store.Store, todoist api.TodoistAPI, trello api.TrelloAPI, planToEat api.PlanToEatAPI, googleCalendar api.GoogleCalendarAPI, googleTasks api.GoogleTasksAPI, cfg *config.Config) *Handler {
+func New(s *store.Store, todoist api.TodoistAPI, trello api.TrelloAPI, planToEat api.PlanToEatAPI, googleCalendar api.GoogleCalendarAPI, googleTasks api.GoogleTasksAPI, cfg *config.Config, buildVersion string) *Handler {
// Template functions
funcMap := template.FuncMap{
"subtract": func(a, b int) int { return a - b },
@@ -59,6 +60,7 @@ func New(s *store.Store, todoist api.TodoistAPI, trello api.TrelloAPI, planToEat
googleTasksClient: googleTasks,
config: cfg,
renderer: NewTemplateRenderer(tmpl),
+ BuildVersion: buildVersion,
}
}
@@ -96,11 +98,13 @@ func (h *Handler) HandleDashboard(w http.ResponseWriter, r *http.Request) {
ActiveTab string
CSRFToken string
BackgroundURL string
+ BuildVersion string
}{
DashboardData: dashboardData,
ActiveTab: tab,
CSRFToken: auth.GetCSRFTokenFromContext(ctx),
BackgroundURL: backgroundURL,
+ BuildVersion: h.BuildVersion,
}
if err := h.renderer.Render(w, "index.html", data); err != nil {