diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-13 14:25:03 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-13 14:25:03 -1000 |
| commit | fbf803978e1512b6833188cd91a7f00df1244e8b (patch) | |
| tree | 3a076139b043d1a7ed3799b890b7513215b2a3f9 /internal/handlers | |
| parent | a7a9aa3dcfe4b90d9b32791c8313a0019ad11289 (diff) | |
Add Todoist tasks with completion checkboxes to Planning tab
Make Todoist tasks visible by integrating into Planning tab:
- Add todoist-tasks template to planning-tab.html
- Update HandlePlanning to fetch and pass Tasks data
- Pass empty Projects slice (quick add form won't show initially)
- Completion checkboxes now visible and functional
Tasks with checkboxes now appear on Planning tab above Trello boards.
Users can click checkboxes to complete tasks instantly.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers')
| -rw-r--r-- | internal/handlers/tabs.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/internal/handlers/tabs.go b/internal/handlers/tabs.go index b8e7bcb..c23910d 100644 --- a/internal/handlers/tabs.go +++ b/internal/handlers/tabs.go @@ -108,7 +108,7 @@ func (h *TabsHandler) HandleTasks(w http.ResponseWriter, r *http.Request) { } } -// HandlePlanning renders the Planning tab (Trello boards) +// HandlePlanning renders the Planning tab (Trello boards + Todoist tasks) func (h *TabsHandler) HandlePlanning(w http.ResponseWriter, r *http.Request) { // Fetch Trello boards boards, err := h.store.GetBoards() @@ -118,10 +118,21 @@ func (h *TabsHandler) HandlePlanning(w http.ResponseWriter, r *http.Request) { return } + // Fetch Todoist tasks + tasks, err := h.store.GetTasks() + if err != nil { + log.Printf("Error fetching tasks: %v", err) + tasks = []models.Task{} + } + data := struct { - Boards []models.Board + Boards []models.Board + Tasks []models.Task + Projects []models.Project }{ - Boards: boards, + Boards: boards, + Tasks: tasks, + Projects: []models.Project{}, // Empty for now - form won't display but checkboxes will work } if err := h.templates.ExecuteTemplate(w, "planning-tab", data); err != nil { |
