summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/templates/partials/tasks-tab.html63
1 files changed, 62 insertions, 1 deletions
diff --git a/web/templates/partials/tasks-tab.html b/web/templates/partials/tasks-tab.html
index 9379e5c..ba9aa80 100644
--- a/web/templates/partials/tasks-tab.html
+++ b/web/templates/partials/tasks-tab.html
@@ -1,5 +1,66 @@
{{define "tasks-tab"}}
-<div class="space-y-6">
+<div class="space-y-6"
+ hx-get="/tabs/tasks"
+ hx-trigger="refresh-tasks from:body"
+ hx-target="#tab-content"
+ hx-swap="innerHTML">
+ <!-- Quick Add Form -->
+ <section class="bg-white rounded-lg p-4 shadow-sm">
+ <h3 class="text-lg font-semibold text-gray-900 mb-3">Quick Add</h3>
+ <form hx-post="/unified-add"
+ hx-swap="none"
+ hx-on::after-request="if(event.detail.successful) { this.reset(); document.getElementById('trello-fields').style.display = 'none'; }">
+ <div class="flex flex-wrap gap-2 items-end">
+ <div class="flex-1 min-w-[200px]">
+ <input type="text"
+ name="title"
+ placeholder="Task name..."
+ class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
+ required>
+ </div>
+ <div>
+ <input type="date"
+ name="due_date"
+ class="border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary-500">
+ </div>
+ <div>
+ <select name="source"
+ class="border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-primary-500"
+ onchange="document.getElementById('trello-fields').style.display = this.value === 'trello' ? 'flex' : 'none'">
+ <option value="todoist">Todoist</option>
+ <option value="trello">Trello</option>
+ </select>
+ </div>
+ <button type="submit"
+ class="bg-primary-600 hover:bg-primary-700 text-white px-4 py-2 rounded-lg transition-colors font-medium">
+ Add
+ </button>
+ </div>
+
+ <!-- Trello Fields (Hidden by default) -->
+ <div id="trello-fields" class="flex flex-wrap gap-2 mt-3" style="display: none;">
+ <div>
+ <select name="board_id"
+ class="border border-gray-300 rounded-lg px-3 py-2 text-sm"
+ hx-get="/partials/lists"
+ hx-target="#list-select"
+ hx-trigger="change"
+ hx-swap="innerHTML">
+ <option value="">Select Board...</option>
+ {{range .Boards}}
+ <option value="{{.ID}}">{{.Name}}</option>
+ {{end}}
+ </select>
+ </div>
+ <div>
+ <select id="list-select" name="list_id" class="border border-gray-300 rounded-lg px-3 py-2 text-sm">
+ <option value="">Select List...</option>
+ </select>
+ </div>
+ </div>
+ </form>
+ </section>
+
<!-- Unified Tasks Section -->
<section>
<h2 class="section-header mb-6">