Always show complete package list, even with unready items

This commit is contained in:
2023-08-29 21:34:00 +02:00
parent ce7c67d599
commit 1a823ca2f6

View File

@@ -257,7 +257,7 @@ impl TripPackageListCategoryBlockUnready {
."flex" ."flex"
."flex-col" ."flex-col"
{ {
@for item in category.items.as_ref().unwrap().iter().filter(|item| item.picked) { @for item in category.items.as_ref().unwrap().iter().filter(|item| item.picked && !item.ready) {
(TripPackageListRowUnready::build(trip.id, item)) (TripPackageListRowUnready::build(trip.id, item))
} }
} }
@@ -329,11 +329,19 @@ impl TripPackageList {
."gap-5" ."gap-5"
{ {
@for category in trip.categories() { @for category in trip.categories() {
@let empty = !category
.items
.as_ref()
.unwrap()
.iter()
.any(|item| item.picked);
@if !empty {
(TripPackageListCategoryBlockUnready::build(trip, category)) (TripPackageListCategoryBlockUnready::build(trip, category))
} }
} }
} @else { }
p { "All items are ready, pack the following things:" } }
p { "Pack the following things:" }
div div
."columns-3" ."columns-3"
."gap-5" ."gap-5"
@@ -343,7 +351,6 @@ impl TripPackageList {
} }
} }
} }
}
) )
} }
} }