summaryrefslogtreecommitdiff
path: root/web/templates
diff options
context:
space:
mode:
Diffstat (limited to 'web/templates')
-rw-r--r--web/templates/index.html16
-rw-r--r--web/templates/partials/shopping-tab.html42
2 files changed, 58 insertions, 0 deletions
diff --git a/web/templates/index.html b/web/templates/index.html
index 050f0bf..a5a7f38 100644
--- a/web/templates/index.html
+++ b/web/templates/index.html
@@ -56,6 +56,22 @@
onclick="setActiveTab(this)">
🍽️ Meals
</button>
+ <button
+ class="tab-button {{if eq .ActiveTab "timeline"}}tab-button-active{{end}}"
+ hx-get="/tabs/timeline"
+ hx-target="#tab-content"
+ hx-push-url="?tab=timeline"
+ onclick="setActiveTab(this)">
+ 📅 Timeline
+ </button>
+ <button
+ class="tab-button {{if eq .ActiveTab "shopping"}}tab-button-active{{end}}"
+ hx-get="/tabs/shopping"
+ hx-target="#tab-content"
+ hx-push-url="?tab=shopping"
+ onclick="setActiveTab(this)">
+ 🛒 Shopping
+ </button>
</nav>
</div>
diff --git a/web/templates/partials/shopping-tab.html b/web/templates/partials/shopping-tab.html
new file mode 100644
index 0000000..2362eef
--- /dev/null
+++ b/web/templates/partials/shopping-tab.html
@@ -0,0 +1,42 @@
+{{define "shopping-tab"}}
+<div class="space-y-6 text-shadow-sm"
+ hx-get="/tabs/shopping"
+ hx-trigger="refresh-tasks from:body"
+ hx-target="#tab-content"
+ hx-swap="innerHTML">
+ {{if .Stores}}
+ {{range .Stores}}
+ <section class="bg-black/40 backdrop-blur-sm rounded-xl p-4 sm:p-5">
+ <h2 class="text-xl font-medium mb-4 text-white">{{.Name}}</h2>
+ {{range .Categories}}
+ <div class="mb-4 last:mb-0">
+ {{if .Name}}<h3 class="text-sm text-white/60 mb-2 uppercase tracking-wide">{{.Name}}</h3>{{end}}
+ <ul class="space-y-2">
+ {{range .Items}}
+ <li class="flex items-center gap-3 p-3 bg-black/30 rounded-lg {{if .Checked}}opacity-50{{end}}">
+ <input type="checkbox" {{if .Checked}}checked{{end}}
+ hx-post="/shopping/toggle"
+ hx-vals='{"id":"{{.ID}}","source":"{{.Source}}","checked":{{if .Checked}}false{{else}}true{{end}}}'
+ hx-target="closest li"
+ hx-swap="outerHTML"
+ class="h-5 w-5 rounded bg-black/40 border-white/30 text-green-500 focus:ring-white/30 cursor-pointer flex-shrink-0">
+ <span class="flex-1 {{if .Checked}}line-through text-white/40{{else}}text-white{{end}}">{{.Name}}</span>
+ {{if .Quantity}}<span class="text-white/50 text-sm">{{.Quantity}}</span>{{end}}
+ <span class="text-xs px-2 py-0.5 rounded {{if eq .Source "trello"}}bg-blue-900/50 text-blue-300{{else}}bg-green-900/50 text-green-300{{end}}">
+ {{.Source}}
+ </span>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ {{end}}
+ </section>
+ {{end}}
+ {{else}}
+ <div class="text-center py-16 text-white/50">
+ <p class="text-lg mb-2">No shopping items</p>
+ <p class="text-sm">Add items from PlanToEat or Trello's Shopping board</p>
+ </div>
+ {{end}}
+</div>
+{{end}}