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,7 +59,8 @@ 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 {
if i < 5 {
<li> <li>
<a <a
href={ templ.URL("/app/spaces/" + space.ID + "/lists/" + list.ID) } href={ templ.URL("/app/spaces/" + space.ID + "/lists/" + list.ID) }
@ -69,7 +70,16 @@ templ SpaceOverviewPage(space *model.Space, lists []*model.ShoppingList, tags []
</a> </a>
</li> </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>
} }