diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-23 10:29:02 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-23 10:29:02 -1000 |
| commit | bc4149d7c9fe7a698cf07895b504ab8f2b26f649 (patch) | |
| tree | 0e82f17101ca3d925328c5d087a27285e0704a38 /web/templates/partials/tasks-tab.html | |
| parent | 539122f3c80fe1f27348f0ddfc7fd428a58384b8 (diff) | |
UI improvements: styling and layout fixes
- Prefill first store in shopping quick-add
- Tone down overdue/priority styling (red -> amber)
- Remove quick-add panel from tasks tab (use modal instead)
- Increase card opacity for better readability
- Swap task/event formatting (tasks get cards, events get border-l-4)
- Add grid layout for tasks (2-3 columns on wider screens)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'web/templates/partials/tasks-tab.html')
| -rw-r--r-- | web/templates/partials/tasks-tab.html | 90 |
1 files changed, 9 insertions, 81 deletions
diff --git a/web/templates/partials/tasks-tab.html b/web/templates/partials/tasks-tab.html index 92e7979..db986bb 100644 --- a/web/templates/partials/tasks-tab.html +++ b/web/templates/partials/tasks-tab.html @@ -4,95 +4,23 @@ hx-trigger="refresh-tasks from:body" hx-target="#tab-content" hx-swap="innerHTML"> - <!-- Quick Add Form - Collapsible --> - <section class="card"> - <button type="button" - onclick="document.getElementById('quick-add-form').classList.toggle('hidden')" - class="w-full p-3 sm:p-4 text-left flex justify-between items-center"> - <span class="font-medium text-white">+ Quick Add</span> - <svg class="w-4 h-4 text-white/50" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg> - </button> - <form id="quick-add-form" - class="hidden p-3 sm:p-4 pt-0 border-t border-white/10" - 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-[150px]"> - <input type="text" - name="title" - placeholder="Task name..." - class="w-full bg-black/40 border border-white/20 rounded-lg px-3 py-2 text-sm text-white placeholder-white/50 focus:ring-2 focus:ring-white/30 focus:border-white/30" - required> - </div> - <div> - <input type="date" - name="due_date" - id="quick-add-date" - class="bg-black/40 border border-white/20 rounded-lg px-2 py-2 text-sm text-white focus:ring-2 focus:ring-white/30"> - <script> - (function() { - var d = new Date(); - var dateStr = d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0'); - document.getElementById('quick-add-date').value = dateStr; - })(); - </script> - </div> - <div> - <select name="source" - class="bg-black/40 border border-white/20 rounded-lg px-2 py-2 text-sm text-white focus:ring-2 focus:ring-white/30" - 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-white/20 hover:bg-white/30 text-white px-3 py-2 rounded-lg transition-colors font-medium text-sm"> - 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="bg-black/40 border border-white/20 rounded-lg px-2 py-2 text-sm text-white" - 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="bg-black/40 border border-white/20 rounded-lg px-2 py-2 text-sm text-white"> - <option value="">Select List...</option> - </select> - </div> - </div> - </form> - </section> - <!-- Tasks List --> {{if .Atoms}} - <div class="space-y-2"> + <div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3"> {{range .Atoms}} - <div class="task-item border-l-4 {{.ColorClass}} {{if .IsFuture}}opacity-60{{end}}"> + <div class="bg-white/5 hover:bg-white/10 transition-colors rounded-lg border border-white/5 {{if .IsFuture}}opacity-60{{end}}"> <div class="flex items-start gap-2 sm:gap-3 p-3 sm:p-4"> <!-- Checkbox for completing --> <input type="checkbox" hx-post="/complete-atom" hx-vals='{"id": "{{.ID}}", "source": "{{.Source}}"}' - hx-target="closest .task-item" + hx-target="closest div.rounded-lg" hx-swap="outerHTML" class="mt-1 h-5 w-5 rounded bg-black/40 border-white/30 text-white/80 focus:ring-white/30 cursor-pointer flex-shrink-0"> <span class="text-lg flex-shrink-0">{{.SourceIcon}}</span> <div class="flex-1 min-w-0"> <div class="flex items-start justify-between gap-2"> - <h3 class="text-sm {{if .IsOverdue}}text-red-400 font-semibold{{else if .IsFuture}}text-white/50 font-normal{{else}}text-white font-medium{{end}} break-words cursor-pointer hover:underline" + <h3 class="text-sm {{if .IsOverdue}}text-amber-300 font-medium{{else if .IsFuture}}text-white/50 font-normal{{else}}text-white font-medium{{end}} break-words cursor-pointer hover:underline" hx-get="/tasks/detail?id={{.ID}}&source={{.Source}}" hx-target="#task-edit-content" hx-swap="innerHTML" @@ -107,10 +35,10 @@ </div> <div class="flex flex-wrap items-center gap-2 mt-1 text-xs text-white/50"> {{if .DueDate}} - <span class="{{if .IsOverdue}}text-red-400 font-medium{{end}}">{{.DueDate.Format "Jan 2"}}{{if .HasSetTime}}, {{.DueDate.Format "3:04pm"}}{{end}}</span> + <span class="{{if .IsOverdue}}text-amber-300/80{{end}}">{{.DueDate.Format "Jan 2"}}{{if .HasSetTime}}, {{.DueDate.Format "3:04pm"}}{{end}}</span> {{end}} {{if gt .Priority 2}} - <span class="text-red-400 font-medium">P{{.Priority}}</span> + <span class="text-amber-300/80">P{{.Priority}}</span> {{end}} {{if .Description}} <span class="text-white/40">+details</span> @@ -140,14 +68,14 @@ <span>+{{len .FutureAtoms}} later</span> <svg class="w-4 h-4 transform transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg> </summary> - <div class="space-y-2 mt-2"> + <div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3 mt-2"> {{range .FutureAtoms}} - <div class="task-item border-l-4 {{.ColorClass}} opacity-60"> + <div class="bg-white/5 hover:bg-white/10 transition-colors 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" hx-post="/complete-atom" hx-vals='{"id": "{{.ID}}", "source": "{{.Source}}"}' - hx-target="closest .task-item" + hx-target="closest div.bg-white\\/5" hx-swap="outerHTML" class="mt-1 h-5 w-5 rounded bg-black/40 border-white/30 text-white/80 focus:ring-white/30 cursor-pointer flex-shrink-0"> <span class="text-lg flex-shrink-0">{{.SourceIcon}}</span> |
