summaryrefslogtreecommitdiff
path: root/internal/handlers/tabs.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/tabs.go')
-rw-r--r--internal/handlers/tabs.go56
1 files changed, 2 insertions, 54 deletions
diff --git a/internal/handlers/tabs.go b/internal/handlers/tabs.go
index 1afdd06..7e0b352 100644
--- a/internal/handlers/tabs.go
+++ b/internal/handlers/tabs.go
@@ -126,7 +126,7 @@ func (h *TabsHandler) HandleTasks(w http.ResponseWriter, r *http.Request) {
}
}
-// HandlePlanning renders the Planning tab (Trello boards + Todoist tasks)
+// HandlePlanning renders the Planning tab (Trello boards)
func (h *TabsHandler) HandlePlanning(w http.ResponseWriter, r *http.Request) {
// Fetch Trello boards
boards, err := h.store.GetBoards()
@@ -136,21 +136,12 @@ 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
- Tasks []models.Task
Projects []models.Project
}{
Boards: boards,
- Tasks: tasks,
- Projects: []models.Project{}, // Empty for now - form won't display but checkboxes will work
+ Projects: []models.Project{}, // Empty for now
}
if err := h.templates.ExecuteTemplate(w, "planning-tab", data); err != nil {
@@ -159,49 +150,6 @@ func (h *TabsHandler) HandlePlanning(w http.ResponseWriter, r *http.Request) {
}
}
-// HandleNotes renders the Notes tab (Obsidian notes)
-func (h *TabsHandler) HandleNotes(w http.ResponseWriter, r *http.Request) {
- // Check for search query parameter
- query := r.URL.Query().Get("q")
-
- var notes []models.Note
- var err error
-
- // If search query is present, search notes; otherwise, get all notes
- if query != "" {
- notes, err = h.store.SearchNotes(query)
- } else {
- notes, err = h.store.GetNotes(20)
- }
-
- if err != nil {
- http.Error(w, "Failed to fetch notes", http.StatusInternalServerError)
- log.Printf("Error fetching notes: %v", err)
- return
- }
-
- data := struct {
- Notes []models.Note
- Errors []string
- }{
- Notes: notes,
- Errors: nil,
- }
-
- // Check HX-Target header for partial update
- hxTarget := r.Header.Get("HX-Target")
- templateName := "notes-tab"
- if hxTarget == "notes-results" {
- // Render only the notes list for HTMX partial update
- templateName = "obsidian-notes"
- }
-
- if err := h.templates.ExecuteTemplate(w, templateName, data); err != nil {
- http.Error(w, "Failed to render template", http.StatusInternalServerError)
- log.Printf("Error rendering notes tab: %v", err)
- }
-}
-
// HandleMeals renders the Meals tab (PlanToEat)
func (h *TabsHandler) HandleMeals(w http.ResponseWriter, r *http.Request) {
// Fetch meals for next 7 days