summaryrefslogtreecommitdiff
path: root/web/templates/partials/shopping-mode-items.html
blob: 5dad772bf3d57d9448ddd41a870518384f7028e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{{define "shopping-mode-items"}}
<div class="space-y-2">
    {{if .Items}}
    {{range .Items}}
    {{if not .Checked}}
    <div class="flex items-center gap-3 p-4 bg-white/5 rounded-xl border border-white/10 cursor-pointer"
         hx-post="/shopping/mode/{{$.StoreName}}/complete"
         hx-vals='{"id":"{{.ID}}","source":"{{.Source}}"}'
         hx-target="#shopping-items"
         hx-swap="innerHTML">

        <!-- Checkbox visual -->
        <div class="w-6 h-6 rounded-full border-2 border-white/30 flex items-center justify-center flex-shrink-0"></div>

        <!-- Item content -->
        <div class="flex-1 min-w-0">
            <span class="text-white">{{.Name}}</span>{{if .Quantity}} <span class="text-sm text-white/50 item-qty">({{.Quantity}})</span>{{end}}
        </div>

        <!-- Source badge -->
        <span class="text-xs px-2 py-0.5 rounded flex-shrink-0
                    {{if eq .Source "trello"}}bg-blue-900/50 text-blue-300
                    {{else if eq .Source "user"}}bg-purple-900/50 text-purple-300
                    {{else}}bg-green-900/50 text-green-300{{end}}">
            {{.Source}}
        </span>
    </div>
    {{end}}
    {{end}}
    {{else}}
    <div class="text-center py-16 text-white/50">
        <p class="text-lg mb-2">No items</p>
        <p class="text-sm">Add items using the form below</p>
    </div>
    {{end}}
</div>
{{end}}