feat: show up to 5 shopping lists in overview
This commit is contained in:
parent
05aaca3600
commit
e8a202cb3d
1 changed files with 19 additions and 9 deletions
|
|
@ -59,7 +59,8 @@ templ SpaceOverviewPage(space *model.Space, lists []*model.ShoppingList, tags []
|
|||
<h2 class="text-lg font-semibold mb-2">Shopping Lists</h2>
|
||||
if len(lists) > 0 {
|
||||
<ul class="space-y-1">
|
||||
for _, list := range lists {
|
||||
for i, list := range lists {
|
||||
if i < 5 {
|
||||
<li>
|
||||
<a
|
||||
href={ templ.URL("/app/spaces/" + space.ID + "/lists/" + list.ID) }
|
||||
|
|
@ -69,7 +70,16 @@ templ SpaceOverviewPage(space *model.Space, lists []*model.ShoppingList, tags []
|
|||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
</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 {
|
||||
<p class="text-sm text-muted-foreground">No shopping lists yet.</p>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue