summaryrefslogtreecommitdiff
path: root/internal/handlers/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/handlers.go')
-rw-r--r--internal/handlers/handlers.go22
1 files changed, 6 insertions, 16 deletions
diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go
index ee28a87..e0e185d 100644
--- a/internal/handlers/handlers.go
+++ b/internal/handlers/handlers.go
@@ -665,22 +665,12 @@ func (h *Handler) handleAtomToggle(w http.ResponseWriter, r *http.Request, compl
}
// Return completed task HTML with uncomplete option
- completedHTML := fmt.Sprintf(`<div class="bg-white/5 rounded-lg border border-white/5 opacity-60">
- <div class="flex items-start gap-2 sm:gap-3 p-3 sm:p-4">
- <input type="checkbox" checked
- hx-post="/uncomplete-atom"
- hx-vals='{"id": "%s", "source": "%s"}'
- hx-target="closest div.rounded-lg"
- hx-swap="outerHTML"
- class="mt-1 h-5 w-5 rounded bg-black/40 border-white/30 text-green-600 cursor-pointer flex-shrink-0">
- <span class="text-lg flex-shrink-0">✓</span>
- <div class="flex-1 min-w-0">
- <h3 class="text-sm font-medium text-white/40 line-through break-words">%s</h3>
- <div class="text-xs text-green-400/70 mt-1">Completed - click to undo</div>
- </div>
- </div>
- </div>`, template.HTMLEscapeString(id), template.HTMLEscapeString(source), template.HTMLEscapeString(title))
- HTMLString(w, completedHTML)
+ data := struct {
+ ID string
+ Source string
+ Title string
+ }{id, source, title}
+ HTMLResponse(w, h.templates, "completed-atom", data)
} else {
// Invalidate cache to force refresh
switch source {