summaryrefslogtreecommitdiff
path: root/internal/handlers/timeline.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/timeline.go')
-rw-r--r--internal/handlers/timeline.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/handlers/timeline.go b/internal/handlers/timeline.go
index 9656d4c..9284451 100644
--- a/internal/handlers/timeline.go
+++ b/internal/handlers/timeline.go
@@ -101,6 +101,10 @@ type TimelineData struct {
// Current time for "now" line
NowHour int
NowMinute int
+
+ // Opt-in budget/availability indicator for Today -- nil when no
+ // budget-tracked task exists (see computeBudgetStatus).
+ BudgetStatus *models.BudgetStatus
}
// HandleTimeline renders the timeline view
@@ -204,6 +208,12 @@ func (h *Handler) HandleTimeline(w http.ResponseWriter, r *http.Request) {
data.TomorrowHours = append(data.TomorrowHours, h)
}
+ budgetStatus, err := h.computeBudgetStatus(now)
+ if err != nil {
+ log.Printf("Warning: failed to compute budget status: %v", err)
+ }
+ data.BudgetStatus = budgetStatus
+
HTMLResponse(w, h.renderer, "timeline-tab", data)
}