feat: show up to 5 shopping lists in overview

This commit is contained in:
juancwu 2026-02-07 15:14:51 +00:00
commit e8a202cb3d

View file

@ -59,17 +59,27 @@ templ SpaceOverviewPage(space *model.Space, lists []*model.ShoppingList, tags []
<h2 class="text-lg font-semibold mb-2">Shopping Lists</h2> <h2 class="text-lg font-semibold mb-2">Shopping Lists</h2>
if len(lists) > 0 { if len(lists) > 0 {
<ul class="space-y-1"> <ul class="space-y-1">
for _, list := range lists { for i, list := range lists {
<li> if i < 5 {
<a <li>
href={ templ.URL("/app/spaces/" + space.ID + "/lists/" + list.ID) } <a
class="block px-3 py-2 rounded-md hover:bg-muted transition-colors text-sm" href={ templ.URL("/app/spaces/" + space.ID + "/lists/" + list.ID) }
> class="block px-3 py-2 rounded-md hover:bg-muted transition-colors text-sm"
{ list.Name } >
</a> { list.Name }
</li> </a>
</li>
}
} }
</ul> </ul>
if len(lists) > 5 {
<a
href={ templ.URL("/app/spaces/" + space.ID + "/lists") }
class="block text-sm text-muted-foreground hover:text-foreground transition-colors mt-2 px-3"
>
View all shopping lists
</a>
}
} else { } else {
<p class="text-sm text-muted-foreground">No shopping lists yet.</p> <p class="text-sm text-muted-foreground">No shopping lists yet.</p>
} }