From a7a9aa3dcfe4b90d9b32791c8313a0019ad11289 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Tue, 13 Jan 2026 14:20:41 -1000 Subject: Implement Todoist write operations - Handlers & UI (Part 2) Complete Todoist task creation and completion functionality: Handlers: - Update aggregateData to fetch and populate Projects - Add HandleCreateTask: creates task, refreshes list, re-renders - Add HandleCompleteTask: marks task complete, returns empty - Both handlers pass Projects to template for dropdown Routes: - Register POST /tasks for task creation - Register POST /tasks/complete for task completion UI (todoist-tasks.html): - Add Quick Add form with collapsible details element - Project selector dropdown (iterates over .Projects) - Content input field with validation - HTMX integration: hx-post, hx-target, hx-swap - Functional completion checkboxes on each task - Remove disabled attribute from checkboxes - Add todoist-task-item wrapper class for HTMX targeting - Glassmorphism styling for form Features: - Create Todoist tasks with optional project assignment - Mark tasks complete with single click (disappears) - Real-time task list updates without page reload - Seamless HTMX partial updates All tests pass. Full Todoist write operations now live in UI! Co-Authored-By: Claude Sonnet 4.5 --- web/templates/partials/todoist-tasks.html | 49 ++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'web/templates/partials/todoist-tasks.html') diff --git a/web/templates/partials/todoist-tasks.html b/web/templates/partials/todoist-tasks.html index 7595ac7..25faf47 100644 --- a/web/templates/partials/todoist-tasks.html +++ b/web/templates/partials/todoist-tasks.html @@ -1,17 +1,58 @@ {{define "todoist-tasks"}} -
+

Todoist Tasks

+ + {{if .Projects}} +
+ + + Quick Add Task + +
+ + + + + + +
+
+ {{end}} + + {{if .Tasks}}
{{range .Tasks}} -
- +
+ + +

{{.Content}} -- cgit v1.2.3