From 9eca4673cd4f42c2e5619a8234774ece84a4b34a Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 3 Jan 2025 20:49:12 +0100 Subject: [PATCH] small tweaks --- .../components/display/IngredientsTable.vue | 2 +- vue3/src/locales/ar.json | 1 + vue3/src/locales/bg.json | 1 + vue3/src/locales/ca.json | 1 + vue3/src/locales/cs.json | 1 + vue3/src/locales/da.json | 1 + vue3/src/locales/de.json | 1 + vue3/src/locales/el.json | 1 + vue3/src/locales/en.json | 1 + vue3/src/locales/es.json | 1 + vue3/src/locales/fi.json | 1 + vue3/src/locales/fr.json | 1 + vue3/src/locales/he.json | 1 + vue3/src/locales/hu.json | 1 + vue3/src/locales/hy.json | 1 + vue3/src/locales/id.json | 1 + vue3/src/locales/is.json | 1 + vue3/src/locales/it.json | 1 + vue3/src/locales/lt.json | 1 + vue3/src/locales/nb_NO.json | 1 + vue3/src/locales/nl.json | 1 + vue3/src/locales/pl.json | 1 + vue3/src/locales/pt.json | 1 + vue3/src/locales/pt_BR.json | 1 + vue3/src/locales/ro.json | 1 + vue3/src/locales/ru.json | 1 + vue3/src/locales/sl.json | 1 + vue3/src/locales/sv.json | 1 + vue3/src/locales/tr.json | 1 + vue3/src/locales/uk.json | 1 + vue3/src/locales/zh_Hans.json | 1 + vue3/src/locales/zh_Hant.json | 1 + vue3/src/pages/IngredientEditorPage.vue | 69 ++++++++++++++++--- vue3/src/pages/ModelListPage.vue | 4 +- 34 files changed, 92 insertions(+), 14 deletions(-) diff --git a/vue3/src/components/display/IngredientsTable.vue b/vue3/src/components/display/IngredientsTable.vue index 33048f1129..f67a98b2d0 100644 --- a/vue3/src/components/display/IngredientsTable.vue +++ b/vue3/src/components/display/IngredientsTable.vue @@ -8,7 +8,7 @@ - + diff --git a/vue3/src/locales/ar.json b/vue3/src/locales/ar.json index 93973cf544..d9b5c0d673 100644 --- a/vue3/src/locales/ar.json +++ b/vue3/src/locales/ar.json @@ -143,6 +143,7 @@ "Ingredient": "", "Ingredient Editor": "", "Ingredient Overview": "", + "IngredientEditorHelp": "", "IngredientInShopping": "", "Ingredients": "", "Inherit": "", diff --git a/vue3/src/locales/bg.json b/vue3/src/locales/bg.json index afc8673eca..3ee9511f04 100644 --- a/vue3/src/locales/bg.json +++ b/vue3/src/locales/bg.json @@ -139,6 +139,7 @@ "Information": "Информация", "Ingredient": "", "Ingredient Editor": "Редактор на съставки", + "IngredientEditorHelp": "", "IngredientInShopping": "Тази съставка е във вашия списък за пазаруване.", "Ingredients": "Съставки", "Inherit": "Наследете", diff --git a/vue3/src/locales/ca.json b/vue3/src/locales/ca.json index 51a18e2289..c962163359 100644 --- a/vue3/src/locales/ca.json +++ b/vue3/src/locales/ca.json @@ -186,6 +186,7 @@ "Ingredient": "", "Ingredient Editor": "Editor d'ingredients", "Ingredient Overview": "", + "IngredientEditorHelp": "", "IngredientInShopping": "", "Ingredients": "", "Inherit": "", diff --git a/vue3/src/locales/cs.json b/vue3/src/locales/cs.json index 39ed67e1ad..4c27458325 100644 --- a/vue3/src/locales/cs.json +++ b/vue3/src/locales/cs.json @@ -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", diff --git a/vue3/src/locales/da.json b/vue3/src/locales/da.json index a5553931a8..1d022ec5fc 100644 --- a/vue3/src/locales/da.json +++ b/vue3/src/locales/da.json @@ -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", diff --git a/vue3/src/locales/de.json b/vue3/src/locales/de.json index af194d1e51..68ec43420d 100644 --- a/vue3/src/locales/de.json +++ b/vue3/src/locales/de.json @@ -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", diff --git a/vue3/src/locales/el.json b/vue3/src/locales/el.json index a06a8f6291..1e212f61b4 100644 --- a/vue3/src/locales/el.json +++ b/vue3/src/locales/el.json @@ -169,6 +169,7 @@ "Ingredient": "", "Ingredient Editor": "Επεξεργαστής συστατικών", "Ingredient Overview": "Σύνοψη υλικών", + "IngredientEditorHelp": "", "IngredientInShopping": "Αυτό το υλικό είναι στη λίστα αγορών.", "Ingredients": "Υλικά", "Inherit": "Κληρονόμηση", diff --git a/vue3/src/locales/en.json b/vue3/src/locales/en.json index 738b95ea63..0a0764c096 100644 --- a/vue3/src/locales/en.json +++ b/vue3/src/locales/en.json @@ -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", diff --git a/vue3/src/locales/es.json b/vue3/src/locales/es.json index 1dc714e87f..ed02d6f9f1 100644 --- a/vue3/src/locales/es.json +++ b/vue3/src/locales/es.json @@ -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", diff --git a/vue3/src/locales/fi.json b/vue3/src/locales/fi.json index 0e5f1ed9e8..6d070169f7 100644 --- a/vue3/src/locales/fi.json +++ b/vue3/src/locales/fi.json @@ -101,6 +101,7 @@ "Import_finished": "Tuonti valmistui", "Information": "Tiedot", "Ingredient": "", + "IngredientEditorHelp": "", "Ingredients": "Ainesosat", "Instructions": "Ohjeet", "InstructionsEditHelp": "", diff --git a/vue3/src/locales/fr.json b/vue3/src/locales/fr.json index a127cb1e64..c7c8d8b979 100644 --- a/vue3/src/locales/fr.json +++ b/vue3/src/locales/fr.json @@ -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", diff --git a/vue3/src/locales/he.json b/vue3/src/locales/he.json index 9d324134a0..726dd1f755 100644 --- a/vue3/src/locales/he.json +++ b/vue3/src/locales/he.json @@ -187,6 +187,7 @@ "Ingredient": "", "Ingredient Editor": "עורך המרכיב", "Ingredient Overview": "סקירת רכיב", + "IngredientEditorHelp": "", "IngredientInShopping": "רכיב זה ברשימת הקניות.", "Ingredients": "מרכיבים", "Inherit": "ירושה", diff --git a/vue3/src/locales/hu.json b/vue3/src/locales/hu.json index 226a7a751a..d07a6d2323 100644 --- a/vue3/src/locales/hu.json +++ b/vue3/src/locales/hu.json @@ -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": "", diff --git a/vue3/src/locales/hy.json b/vue3/src/locales/hy.json index 4c343b60bf..50c78b7f4c 100644 --- a/vue3/src/locales/hy.json +++ b/vue3/src/locales/hy.json @@ -76,6 +76,7 @@ "Import_finished": "Ներմուծումն ավարտված է", "Information": "Տեղեկություն", "Ingredient": "", + "IngredientEditorHelp": "", "Ingredients": "", "InstructionsEditHelp": "", "Invite_Link": "", diff --git a/vue3/src/locales/id.json b/vue3/src/locales/id.json index ba91cc3f01..5afc5b1742 100644 --- a/vue3/src/locales/id.json +++ b/vue3/src/locales/id.json @@ -157,6 +157,7 @@ "Ingredient": "", "Ingredient Editor": "Editor Bahan", "Ingredient Overview": "", + "IngredientEditorHelp": "", "IngredientInShopping": "", "Ingredients": "bahan-bahan", "Inherit": "", diff --git a/vue3/src/locales/is.json b/vue3/src/locales/is.json index 92b0318ede..3201733ed1 100644 --- a/vue3/src/locales/is.json +++ b/vue3/src/locales/is.json @@ -186,6 +186,7 @@ "Ingredient": "", "Ingredient Editor": "", "Ingredient Overview": "", + "IngredientEditorHelp": "", "IngredientInShopping": "", "Ingredients": "", "Inherit": "", diff --git a/vue3/src/locales/it.json b/vue3/src/locales/it.json index 4177eaf257..b5171b18e4 100644 --- a/vue3/src/locales/it.json +++ b/vue3/src/locales/it.json @@ -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", diff --git a/vue3/src/locales/lt.json b/vue3/src/locales/lt.json index b20a5daf1d..dacac2a274 100644 --- a/vue3/src/locales/lt.json +++ b/vue3/src/locales/lt.json @@ -172,6 +172,7 @@ "Ingredient": "", "Ingredient Editor": "Ingredientų redaktorius", "Ingredient Overview": "", + "IngredientEditorHelp": "", "IngredientInShopping": "", "Ingredients": "", "Inherit": "", diff --git a/vue3/src/locales/nb_NO.json b/vue3/src/locales/nb_NO.json index 0614d6182f..307e964cba 100644 --- a/vue3/src/locales/nb_NO.json +++ b/vue3/src/locales/nb_NO.json @@ -167,6 +167,7 @@ "Ingredient": "", "Ingredient Editor": "Ingrediens Behandler", "Ingredient Overview": "", + "IngredientEditorHelp": "", "IngredientInShopping": "Denne ingrediensen er i handlekurven din.", "Ingredients": "Ingredienser", "Inherit": "Arve", diff --git a/vue3/src/locales/nl.json b/vue3/src/locales/nl.json index 9ebf9fd25f..6905ea8183 100644 --- a/vue3/src/locales/nl.json +++ b/vue3/src/locales/nl.json @@ -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", diff --git a/vue3/src/locales/pl.json b/vue3/src/locales/pl.json index 1dc3764f90..7a0b6f6fdc 100644 --- a/vue3/src/locales/pl.json +++ b/vue3/src/locales/pl.json @@ -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", diff --git a/vue3/src/locales/pt.json b/vue3/src/locales/pt.json index 9548365c61..6cea7ea9c9 100644 --- a/vue3/src/locales/pt.json +++ b/vue3/src/locales/pt.json @@ -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", diff --git a/vue3/src/locales/pt_BR.json b/vue3/src/locales/pt_BR.json index f685c4d807..91df6002f6 100644 --- a/vue3/src/locales/pt_BR.json +++ b/vue3/src/locales/pt_BR.json @@ -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", diff --git a/vue3/src/locales/ro.json b/vue3/src/locales/ro.json index 9e2daf0eaf..b38958cb6d 100644 --- a/vue3/src/locales/ro.json +++ b/vue3/src/locales/ro.json @@ -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", diff --git a/vue3/src/locales/ru.json b/vue3/src/locales/ru.json index 0394a1890c..746956231c 100644 --- a/vue3/src/locales/ru.json +++ b/vue3/src/locales/ru.json @@ -126,6 +126,7 @@ "Information": "Информация", "Ingredient": "", "Ingredient Editor": "Редактор ингредиентов", + "IngredientEditorHelp": "", "IngredientInShopping": "Этот ингредиент в вашем списке покупок.", "Ingredients": "Ингредиенты", "Inherit": "Наследовать", diff --git a/vue3/src/locales/sl.json b/vue3/src/locales/sl.json index f4d7cedf75..3d9f49410c 100644 --- a/vue3/src/locales/sl.json +++ b/vue3/src/locales/sl.json @@ -122,6 +122,7 @@ "Information": "Informacija", "Ingredient": "", "Ingredient Editor": "Urejevalnik Sestavin", + "IngredientEditorHelp": "", "IngredientInShopping": "Ta sestavina je v tvojem nakupovalnem listku.", "Ingredients": "Sestavine", "Inherit": "Podeduj", diff --git a/vue3/src/locales/sv.json b/vue3/src/locales/sv.json index 44d1aac969..148b797108 100644 --- a/vue3/src/locales/sv.json +++ b/vue3/src/locales/sv.json @@ -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", diff --git a/vue3/src/locales/tr.json b/vue3/src/locales/tr.json index 38c7e9dba6..8f192735ca 100644 --- a/vue3/src/locales/tr.json +++ b/vue3/src/locales/tr.json @@ -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", diff --git a/vue3/src/locales/uk.json b/vue3/src/locales/uk.json index 63e1b56ee2..0eb3d887a1 100644 --- a/vue3/src/locales/uk.json +++ b/vue3/src/locales/uk.json @@ -148,6 +148,7 @@ "Information": "Інформація", "Ingredient": "", "Ingredient Editor": "Редактор Інгредієнтів", + "IngredientEditorHelp": "", "IngredientInShopping": "Цей інгредієнт є в вашому списку покупок.", "Ingredients": "Інгредієнти", "Inherit": "Успадкувати", diff --git a/vue3/src/locales/zh_Hans.json b/vue3/src/locales/zh_Hans.json index eeae4595dc..a051260e5a 100644 --- a/vue3/src/locales/zh_Hans.json +++ b/vue3/src/locales/zh_Hans.json @@ -183,6 +183,7 @@ "Ingredient": "", "Ingredient Editor": "食材编辑器", "Ingredient Overview": "食材概述", + "IngredientEditorHelp": "", "IngredientInShopping": "此食材已在购物清单中。", "Ingredients": "食材", "Inherit": "继承", diff --git a/vue3/src/locales/zh_Hant.json b/vue3/src/locales/zh_Hant.json index e72c794ea4..77b49d19c0 100644 --- a/vue3/src/locales/zh_Hant.json +++ b/vue3/src/locales/zh_Hant.json @@ -61,6 +61,7 @@ "Import_finished": "匯入完成", "Information": "", "Ingredient": "", + "IngredientEditorHelp": "", "Ingredients": "", "InstructionsEditHelp": "", "Invite_Link": "", diff --git a/vue3/src/pages/IngredientEditorPage.vue b/vue3/src/pages/IngredientEditorPage.vue index ecc6b68b31..3dea67673d 100644 --- a/vue3/src/pages/IngredientEditorPage.vue +++ b/vue3/src/pages/IngredientEditorPage.vue @@ -3,14 +3,19 @@ {{ $t('Ingredient Editor') }} - + + + + + + - + @@ -85,7 +96,7 @@ - {{ r.name }} + {{ r.name }} (#{{ r.id }}) @@ -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 + }) + } +} +