added "show all" toggle on list of shopping lists

This commit is contained in:
Michael Genson 2024-02-23 17:07:43 +00:00
parent 0bf3aed287
commit 8e5ea1df5e
3 changed files with 18 additions and 2 deletions

View File

@ -142,6 +142,7 @@
"save": "Save",
"settings": "Settings",
"share": "Share",
"show-all": "Show All",
"shuffle": "Shuffle",
"sort": "Sort",
"sort-alphabetically": "Alphabetical",

View File

@ -505,6 +505,7 @@ export interface ShoppingListOut {
createdAt?: string;
updateAt?: string;
groupId: string;
userId: string;
id: string;
listItems?: ShoppingListItemOut[];
recipeReferences: ShoppingListRecipeRefOut[];
@ -568,6 +569,7 @@ export interface ShoppingListSave {
createdAt?: string;
updateAt?: string;
groupId: string;
userId: string;
}
export interface ShoppingListSummary {
name?: string;
@ -577,6 +579,7 @@ export interface ShoppingListSummary {
createdAt?: string;
updateAt?: string;
groupId: string;
userId: string;
id: string;
recipeReferences: ShoppingListRecipeRefOut[];
labelSettings: ShoppingListMultiPurposeLabelOut[];
@ -589,6 +592,7 @@ export interface ShoppingListUpdate {
createdAt?: string;
updateAt?: string;
groupId: string;
userId: string;
id: string;
listItems?: ShoppingListItemOut[];
}

View File

@ -15,10 +15,20 @@
</template>
<template #title>{{ $t('shopping-list.shopping-lists') }}</template>
</BasePageTitle>
<BaseButton create @click="createDialog = true" />
<v-container class="d-flex justify-end px-0 pt-0 pb-4">
<v-checkbox v-model="showAll" :label="$tc('general.show-all')" class="my-auto mr-4" />
<BaseButton create @click="createDialog = true" />
</v-container>
<section>
<v-card v-for="list in shoppingLists" :key="list.id" class="my-2 left-border" :to="`/shopping-lists/${list.id}`">
<v-card
v-for="list in shoppingLists"
v-if="showAll || ($auth.user && $auth.user.id == list.userId)"
:key="list.id"
class="my-2 left-border"
:to="`/shopping-lists/${list.id}`
">
<v-card-title>
<v-icon left>
{{ $globals.icons.cartCheck }}
@ -56,6 +66,7 @@ export default defineComponent({
createDialog: false,
deleteDialog: false,
deleteTarget: "",
showAll: false,
});
const shoppingLists = useAsync(async () => {