Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Jan 3, 2025
1 parent ac41a55 commit 9eca467
Show file tree
Hide file tree
Showing 34 changed files with 92 additions and 14 deletions.
2 changes: 1 addition & 1 deletion vue3/src/components/display/IngredientsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<!-- </v-table>-->

<v-data-table :items="ingredients" hide-default-footer hide-default-header :headers="tableHeaders" density="compact" v-if="ingredients.length > 0" @click:row="handleRowClick">
<v-data-table :items="ingredients" hide-default-footer hide-default-header :headers="tableHeaders" density="compact" v-if="ingredients.length > 0" @click:row="handleRowClick" items-per-page="0">
<template v-slot:item.checked="{ item }">
<v-checkbox-btn v-model="item.checked" color="success"></v-checkbox-btn>
</template>
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"Ingredient": "",
"Ingredient Editor": "",
"Ingredient Overview": "",
"IngredientEditorHelp": "",
"IngredientInShopping": "",
"Ingredients": "",
"Inherit": "",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"Information": "Информация",
"Ingredient": "",
"Ingredient Editor": "Редактор на съставки",
"IngredientEditorHelp": "",
"IngredientInShopping": "Тази съставка е във вашия списък за пазаруване.",
"Ingredients": "Съставки",
"Inherit": "Наследете",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
"Ingredient": "",
"Ingredient Editor": "Editor d'ingredients",
"Ingredient Overview": "",
"IngredientEditorHelp": "",
"IngredientInShopping": "",
"Ingredients": "",
"Inherit": "",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
"Ingredient": "",
"Ingredient Editor": "Editace ingrediencí",
"Ingredient Overview": "Přehled ingrediencí",
"IngredientEditorHelp": "",
"IngredientInShopping": "Tato ingredience je na vašem nákupním seznamu.",
"Ingredients": "Ingredience",
"Inherit": "Propsat",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"Ingredient": "",
"Ingredient Editor": "Ingrediens redigeringsværktøj",
"Ingredient Overview": "Ingrediensoversigt",
"IngredientEditorHelp": "",
"IngredientInShopping": "Denne ingrediens er i din indkøbsliste.",
"Ingredients": "Ingredienser",
"Inherit": "Nedarve",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"Ingredient": "Zutat",
"Ingredient Editor": "Zutateneditor",
"Ingredient Overview": "Zutatenübersicht",
"IngredientEditorHelp": "Mit dem Zutateneditor können alle Zutaten die ein bestimmtes Lebensmittel und/oder eine bestimmte Einheit benutzen auf einmal editiert werden. Dies ist praktisch um Fehler zu korrigieren oder mehrere Rezepte auf einmal zu bearbeiten.",
"IngredientInShopping": "Diese Zutat befindet sich auf Ihrer Einkaufsliste.",
"Ingredients": "Zutaten",
"Inherit": "Vererben",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
"Ingredient": "",
"Ingredient Editor": "Επεξεργαστής συστατικών",
"Ingredient Overview": "Σύνοψη υλικών",
"IngredientEditorHelp": "",
"IngredientInShopping": "Αυτό το υλικό είναι στη λίστα αγορών.",
"Ingredients": "Υλικά",
"Inherit": "Κληρονόμηση",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"Ingredient": "Ingredient",
"Ingredient Editor": "Ingredient Editor",
"Ingredient Overview": "Ingredient Overview",
"IngredientEditorHelp": "With the ingredient editor you can edit all Ingredients that use a certain Food and/or Unit at once. This can be used to easily correct errors or change multiple recipes at once.",
"IngredientInShopping": "This ingredient is in your shopping list.",
"Ingredients": "Ingredients",
"Inherit": "Inherit",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"Ingredient": "",
"Ingredient Editor": "Ingredientes",
"Ingredient Overview": "Vistazo de Ingredientes",
"IngredientEditorHelp": "",
"IngredientInShopping": "Este ingrediente ya esta en la lista de la compra.",
"Ingredients": "Ingredientes",
"Inherit": "Heredar",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"Import_finished": "Tuonti valmistui",
"Information": "Tiedot",
"Ingredient": "",
"IngredientEditorHelp": "",
"Ingredients": "Ainesosat",
"Instructions": "Ohjeet",
"InstructionsEditHelp": "",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
"Ingredient": "",
"Ingredient Editor": "Éditeur d’ingrédients",
"Ingredient Overview": "Aperçu des ingrédients",
"IngredientEditorHelp": "",
"IngredientInShopping": "Cet ingrédient est dans votre liste de courses.",
"Ingredients": "Ingrédients",
"Inherit": "Hériter",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"Ingredient": "",
"Ingredient Editor": "עורך המרכיב",
"Ingredient Overview": "סקירת רכיב",
"IngredientEditorHelp": "",
"IngredientInShopping": "רכיב זה ברשימת הקניות.",
"Ingredients": "מרכיבים",
"Inherit": "ירושה",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
"Ingredient": "",
"Ingredient Editor": "Hozzávalók szerkesztője",
"Ingredient Overview": "Hozzávalók áttekintése",
"IngredientEditorHelp": "",
"IngredientInShopping": "Ez a hozzávaló szerepel a bevásárlólistán.",
"Ingredients": "Hozzávalók",
"Inherit": "",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/hy.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"Import_finished": "Ներմուծումն ավարտված է",
"Information": "Տեղեկություն",
"Ingredient": "",
"IngredientEditorHelp": "",
"Ingredients": "",
"InstructionsEditHelp": "",
"Invite_Link": "",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"Ingredient": "",
"Ingredient Editor": "Editor Bahan",
"Ingredient Overview": "",
"IngredientEditorHelp": "",
"IngredientInShopping": "",
"Ingredients": "bahan-bahan",
"Inherit": "",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/is.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
"Ingredient": "",
"Ingredient Editor": "",
"Ingredient Overview": "",
"IngredientEditorHelp": "",
"IngredientInShopping": "",
"Ingredients": "",
"Inherit": "",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
"Ingredient": "",
"Ingredient Editor": "Editor Ingredienti",
"Ingredient Overview": "Panoramica Ingredienti",
"IngredientEditorHelp": "",
"IngredientInShopping": "Questo ingrediente è nella tua lista della spesa.",
"Ingredients": "Ingredienti",
"Inherit": "Eredita",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
"Ingredient": "",
"Ingredient Editor": "Ingredientų redaktorius",
"Ingredient Overview": "",
"IngredientEditorHelp": "",
"IngredientInShopping": "",
"Ingredients": "",
"Inherit": "",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/nb_NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"Ingredient": "",
"Ingredient Editor": "Ingrediens Behandler",
"Ingredient Overview": "",
"IngredientEditorHelp": "",
"IngredientInShopping": "Denne ingrediensen er i handlekurven din.",
"Ingredients": "Ingredienser",
"Inherit": "Arve",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
"Ingredient": "",
"Ingredient Editor": "Ingrediënten editor",
"Ingredient Overview": "Ingrediëntenlijst",
"IngredientEditorHelp": "",
"IngredientInShopping": "Dit ingrediënt staat op je boodschappenlijst.",
"Ingredients": "Ingrediënten",
"Inherit": "Erf",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"Ingredient": "",
"Ingredient Editor": "Edytor składników",
"Ingredient Overview": "Przegląd składników",
"IngredientEditorHelp": "",
"IngredientInShopping": "Ten składnik znajduje się na Twojej liście zakupów.",
"Ingredients": "Składniki",
"Inherit": "Dziedziczenie",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"Information": "Informação",
"Ingredient": "",
"Ingredient Editor": "Editor de Ingredientes",
"IngredientEditorHelp": "",
"IngredientInShopping": "Este ingrediente está na sua lista de compras.",
"Ingredients": "Ingredientes",
"Inherit": "Herdado",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
"Ingredient": "",
"Ingredient Editor": "Editor de Ingrediente",
"Ingredient Overview": "Ingredientes - Visão Geral",
"IngredientEditorHelp": "",
"IngredientInShopping": "Este ingrediente está na sua lista de compras.",
"Ingredients": "Ingredientes",
"Inherit": "Herdado",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
"Ingredient": "",
"Ingredient Editor": "Editor de ingrediente",
"Ingredient Overview": "Prezentare generală a ingredientelor",
"IngredientEditorHelp": "",
"IngredientInShopping": "Acest ingredient se află în lista de cumpărături.",
"Ingredients": "Ingrediente",
"Inherit": "Moștenire",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
"Information": "Информация",
"Ingredient": "",
"Ingredient Editor": "Редактор ингредиентов",
"IngredientEditorHelp": "",
"IngredientInShopping": "Этот ингредиент в вашем списке покупок.",
"Ingredients": "Ингредиенты",
"Inherit": "Наследовать",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"Information": "Informacija",
"Ingredient": "",
"Ingredient Editor": "Urejevalnik Sestavin",
"IngredientEditorHelp": "",
"IngredientInShopping": "Ta sestavina je v tvojem nakupovalnem listku.",
"Ingredients": "Sestavine",
"Inherit": "Podeduj",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"Ingredient": "",
"Ingredient Editor": "Ingrediensredigerare",
"Ingredient Overview": "Ingrediensöversikt",
"IngredientEditorHelp": "",
"IngredientInShopping": "Denna ingrediens finns i din inköpslista.",
"Ingredients": "Ingredienser",
"Inherit": "Ärva",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"Ingredient": "",
"Ingredient Editor": "Malzeme Düzenleyici",
"Ingredient Overview": "Malzeme Genel Bakış",
"IngredientEditorHelp": "",
"IngredientInShopping": "Bu malzeme alışveriş listenizde.",
"Ingredients": "Malzemeler",
"Inherit": "Devral",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
"Information": "Інформація",
"Ingredient": "",
"Ingredient Editor": "Редактор Інгредієнтів",
"IngredientEditorHelp": "",
"IngredientInShopping": "Цей інгредієнт є в вашому списку покупок.",
"Ingredients": "Інгредієнти",
"Inherit": "Успадкувати",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/zh_Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"Ingredient": "",
"Ingredient Editor": "食材编辑器",
"Ingredient Overview": "食材概述",
"IngredientEditorHelp": "",
"IngredientInShopping": "此食材已在购物清单中。",
"Ingredients": "食材",
"Inherit": "继承",
Expand Down
1 change: 1 addition & 0 deletions vue3/src/locales/zh_Hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"Import_finished": "匯入完成",
"Information": "",
"Ingredient": "",
"IngredientEditorHelp": "",
"Ingredients": "",
"InstructionsEditHelp": "",
"Invite_Link": "",
Expand Down
69 changes: 58 additions & 11 deletions vue3/src/pages/IngredientEditorPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
<v-card :loading="filtersLoading">
<v-card-title>{{ $t('Ingredient Editor') }}</v-card-title>
<v-card-text>
<closable-help-alert
class="mb-2"
text="With the ingredient editor you can edit all Ingredients that use a certain Food and/or Unit at once. This can be used to easily correct errors or change multiple recipes at once."></closable-help-alert>
<v-row>
<v-col>
<closable-help-alert
class="mb-2"
:text="$t('IngredientEditorHelp')"></closable-help-alert>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">

<model-select model="Food" v-model="selectedFood" @update:modelValue="refreshPage()" append-to-body>
<template #append>
<v-btn icon variant="plain" >
<v-btn icon variant="plain">
<v-icon icon="$menu"></v-icon>
<v-menu activator="parent">
<v-list density="compact">
Expand All @@ -24,19 +29,22 @@
<model-merge-dialog :source="selectedFood" model="Food"
@change="(obj: Food) => {selectedFood = obj;refreshPage()} "></model-merge-dialog>
</v-list-item>
<v-list-item link prepend-icon="fa-solid fa-carrot" :to="{name: 'ModelListPage', params: {model: 'food'}}">
{{ $t('Database') }}
<v-list-item link prepend-icon="$delete" :disabled="!selectedFood">
{{ $t('Delete') }}
<delete-confirm-dialog :model-name="$t('Food')" :object-name="selectedFood.name" v-if="selectedFood"
@delete="deleteFood()"></delete-confirm-dialog>
</v-list-item>
</v-list>
</v-menu>
</v-btn>
<v-btn icon="fa-solid fa-carrot" :to="{name: 'ModelListPage', params: {model: 'food'}}" variant="plain"></v-btn>
</template>
</model-select>
</v-col>
<v-col>
<v-col cols="12" md="6">
<model-select model="Unit" v-model="selectedUnit" @update:modelValue="refreshPage()" append-to-body>
<template #append>
<v-btn icon variant="plain" >
<v-btn icon variant="plain">
<v-icon icon="$menu"></v-icon>
<v-menu activator="parent">
<v-list density="compact">
Expand All @@ -50,12 +58,15 @@
<model-merge-dialog :source="selectedUnit" model="Unit"
@change="(obj: Food) => {selectedUnit = obj;refreshPage()} "></model-merge-dialog>
</v-list-item>
<v-list-item link prepend-icon="fa-solid fa-scale-balanced" :to="{name: 'ModelListPage', params: {model: 'unit'}}">
{{ $t('Database') }}
<v-list-item link prepend-icon="$delete" :disabled="!selectedUnit">
{{ $t('Delete') }}
<delete-confirm-dialog :model-name="$t('Unit')" :object-name="selectedUnit.name" v-if="selectedUnit"
@delete="deleteUnit()"></delete-confirm-dialog>
</v-list-item>
</v-list>
</v-menu>
</v-btn>
<v-btn icon="fa-solid fa-scale-balanced" :to="{name: 'ModelListPage', params: {model: 'unit'}}" variant="plain"></v-btn>
</template>
</model-select>
</v-col>
Expand Down Expand Up @@ -85,7 +96,7 @@
<tr>
<td :colspan="columns.length">
<v-btn variant="outlined" color="secondary" target="_blank" :to="{name: 'view_recipe', params: {id: r.id}}" v-for="r in item.usedInRecipes">
{{ r.name }}
{{ r.name }} (#{{ r.id }})
</v-btn>
</td>
</tr>
Expand Down Expand Up @@ -290,6 +301,42 @@ function loadItems({page, itemsPerPage, search, sortBy, groupBy}) {
})
}
/**
* delete the selected food
*/
function deleteFood() {
let api = new ApiApi()
if (selectedFood.value) {
filtersLoading.value = true
api.apiFoodDestroy({id: selectedFood.value.id!}).then(r => {
selectedFood.value = null
refreshPage()
}).catch(err => {
useMessageStore().addError(ErrorMessageType.DELETE_ERROR, err)
}).finally(() => {
filtersLoading.value = false
})
}
}
/**
* delete the selected unit
*/
function deleteUnit() {
let api = new ApiApi()
if (selectedUnit.value) {
filtersLoading.value = true
api.apiUnitDestroy({id: selectedUnit.value.id!}).then(r => {
selectedUnit.value = null
refreshPage()
}).catch(err => {
useMessageStore().addError(ErrorMessageType.DELETE_ERROR, err)
}).finally(() => {
filtersLoading.value = false
})
}
}
</script>

<style scoped>
Expand Down
4 changes: 2 additions & 2 deletions vue3/src/pages/ModelListPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<v-btn class="float-right" icon="$create" color="create">
<i class="fa-solid fa-plus"></i>
<model-edit-dialog :close-after-create="false" :model="model"
@create="loadItems({page: tablePage, itemsPerPage: useUserPreferenceStore().deviceSettings.general_tableItemsPerPage})"></model-edit-dialog>
@create="loadItems({page: tablePage, itemsPerPage: useUserPreferenceStore().deviceSettings.general_tableItemsPerPage, search: searchQuery})"></model-edit-dialog>
</v-btn>
</v-col>
</v-row>
Expand Down Expand Up @@ -128,7 +128,7 @@ const genericModel = ref({} as GenericModel)
// when navigating to ModelListPage from ModelListPage with a different model lifecycle hooks are not called so watch for change here
watch(() => props.model, () => {
genericModel.value = getGenericModelFromString(props.model, t)
loadItems({page: 1, itemsPerPage: useUserPreferenceStore().deviceSettings.general_tableItemsPerPage})
loadItems({page: 1, itemsPerPage: useUserPreferenceStore().deviceSettings.general_tableItemsPerPage, search: searchQuery})
})
/**
Expand Down

0 comments on commit 9eca467

Please sign in to comment.