From 9961746f1fdc27287b79dd4989af7b41ccc457a9 Mon Sep 17 00:00:00 2001 From: nough Date: Thu, 7 Jul 2022 15:46:31 +0100 Subject: [PATCH 001/213] update, adding docker backup script outline --- docs/system/updating.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/system/updating.md b/docs/system/updating.md index b38f3fd36..b1da0aa78 100644 --- a/docs/system/updating.md +++ b/docs/system/updating.md @@ -11,6 +11,33 @@ For all setups using Docker the updating process look something like this 2. Pull the latest image using `docker-compose pull` 3. Start the container again using `docker-compose up -d` +## Docker Script +``` +#get vars +input name of docker_db_container +input working directory + +#backup docker +sudo docker exec -t docker_db_recipes_1 pg_dumpall -U djangouser > pgdump.sql + +docker-compose down +mv postgresql date_postgresqlbackup +check that docker-compose.yml files are up to date with latest recommended from install instructions +check that .env is up to date with latest recommended from install instructions + +#start update +docker-compose pull +docker-compose up -d +wait 5 minutes +docker-compose down +docker-compose up -d +wait 5 minutes + +#import database to new setup +cat pgdump.sql | sudo docker exec -i docker_db_recipes_1 psql postgres -U djangouser +docker-compose down +docker-compose up -d +``` ## Manual @@ -20,4 +47,4 @@ After that make sure to run: 1. `manage.py collectstatic` 2. `manage.py migrate` -To apply all new migrations and collect new static files. \ No newline at end of file +To apply all new migrations and collect new static files. From c86ff27bef8c5c0c4c8966b999586452f6f286b6 Mon Sep 17 00:00:00 2001 From: nough Date: Fri, 8 Jul 2022 09:19:48 +0100 Subject: [PATCH 002/213] Update backup.md Further information, backup using import/export. --- docs/system/backup.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/system/backup.md b/docs/system/backup.md index 20e865f9f..cf5a2854f 100644 --- a/docs/system/backup.md +++ b/docs/system/backup.md @@ -31,7 +31,7 @@ The filenames consist of `_`. In case you screw up real The standard docker build of tandoor uses postgresql as the back end database. This can be backed up using a function called "dumpall". This generates a .SQL file containing a list of commands for a postgresql server to use to rebuild your database. You will also need to back up the media files separately. Making a full copy of the docker directory can work as a back up, but only if you know you will be using the same hardware, os, and postgresql version upon restore. If not, then the different version of postgresql won't be compatible with the existing tables. -You can back up from docker even when the tandoor container is failing, so long as the postgresql database has started successfully. +You can back up from docker even when the tandoor container is failing, so long as the postgresql database has started successfully. When using this backup method, ensure that your recipes have imported successfully. One user reported only the titles and images importing on first try, requiring a second run of the import command. the following commands assume that your docker-compose files are in a folder called "docker". replace "docker_db_recipes_1" with the name of your db container. The commands also assume you use a backup name of pgdump.sql. It's a good idea to include a date in this filename, so that successive backups do not get deleted. To back up: @@ -47,3 +47,12 @@ cat pgdump.sql | sudo docker exec -i docker_db_recipes_1 psql postgres -U django ``` This connects to the postgres table instead of the actual dgangodb table, as the import function needs to delete the table, which can't be dropped off you're connected to it. +## Backup using export and import +You can now export recipes from Tandoor using the export function. This method requires a working web interface. +1. Click on a recipe +2. Click on the three meatballs then export +3. Select the all recipes toggle and then export. This should download a zip file. + +Import: +Go to Import > from app > tandoor and select the zip file you want to import from. + From 2f8b479fdd6f1bdf8d829dfa91e979311ce2a517 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 00:28:30 +0000 Subject: [PATCH 003/213] Bump @vue/cli-plugin-pwa from 5.0.4 to 5.0.8 in /vue Bumps [@vue/cli-plugin-pwa](https://github.com/vuejs/vue-cli/tree/HEAD/packages/@vue/cli-plugin-pwa) from 5.0.4 to 5.0.8. - [Release notes](https://github.com/vuejs/vue-cli/releases) - [Changelog](https://github.com/vuejs/vue-cli/blob/dev/CHANGELOG.md) - [Commits](https://github.com/vuejs/vue-cli/commits/v5.0.8/packages/@vue/cli-plugin-pwa) --- updated-dependencies: - dependency-name: "@vue/cli-plugin-pwa" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vue/package.json | 2 +- vue/yarn.lock | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/vue/package.json b/vue/package.json index e51a30fdc..e7b5793fd 100644 --- a/vue/package.json +++ b/vue/package.json @@ -48,7 +48,7 @@ "@typescript-eslint/parser": "^4.32.0", "@vue/cli-plugin-babel": "^5.0.4", "@vue/cli-plugin-eslint": "~5.0.4", - "@vue/cli-plugin-pwa": "^5.0.4", + "@vue/cli-plugin-pwa": "^5.0.8", "@vue/cli-plugin-typescript": "^5.0.4", "@vue/cli-service": "^5.0.4", "@vue/compiler-sfc": "^3.2.29", diff --git a/vue/yarn.lock b/vue/yarn.lock index 8d83a2441..f24b2e221 100644 --- a/vue/yarn.lock +++ b/vue/yarn.lock @@ -11,6 +11,15 @@ event-pubsub "4.3.0" js-message "1.0.7" +"@achrinza/node-ipc@^9.2.5": + version "9.2.5" + resolved "https://registry.yarnpkg.com/@achrinza/node-ipc/-/node-ipc-9.2.5.tgz#29788e608ff41121f0543491da723b243266ac28" + integrity sha512-kBX7Ay911iXZ3VZ1pYltj3Rfu7Ow9H7sK4H4RSfWIfWR2JKNB40K808wppoRIEzE2j2hXLU+r6TJgCAliCGhyQ== + dependencies: + "@node-ipc/js-queue" "2.0.3" + event-pubsub "4.3.0" + js-message "1.0.7" + "@akryum/winattr@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@akryum/winattr/-/winattr-3.0.0.tgz#c345d49f8415583897e345729c12b3503927dd11" @@ -2077,12 +2086,12 @@ webpack "^5.54.0" yorkie "^2.0.0" -"@vue/cli-plugin-pwa@^5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@vue/cli-plugin-pwa/-/cli-plugin-pwa-5.0.4.tgz#e4a7cb79bf05e1156a2ebcfe7ef3f134a28864c4" - integrity sha512-Pim6hx2Lf9kqslhveQ65K+iZhSzDy+IvGidJnpYiwcE9bSgQKG9vPSBgH4qww4u57prXVC8WRbdwupZPEpNhEw== +"@vue/cli-plugin-pwa@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@vue/cli-plugin-pwa/-/cli-plugin-pwa-5.0.8.tgz#b4c55873d96ce6effa08e5b578fe1a5ec6c7fd10" + integrity sha512-MnD9Y6I3nX7c/NawpsJtbXaGFjI9LT5Az7IQjpshS65+yvuOcxV2j/tCjPTrja+zd1VmB4DZUhrfUU2exSBfGg== dependencies: - "@vue/cli-shared-utils" "^5.0.4" + "@vue/cli-shared-utils" "^5.0.8" html-webpack-plugin "^5.1.0" webpack "^5.54.0" workbox-webpack-plugin "^6.1.0" @@ -2176,12 +2185,12 @@ webpack-virtual-modules "^0.4.2" whatwg-fetch "^3.6.2" -"@vue/cli-shared-utils@^5.0.4": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@vue/cli-shared-utils/-/cli-shared-utils-5.0.4.tgz#e3f42575cb6b70e021272ef2c8bb52ca544ecf27" - integrity sha512-nfAsj8Nopu5sVHMBIaut/YL7NaJFVmTBSTJD7LM17jc5uytrM9JwiRtzCiv3JWRBG78Xdb/s2Xb/1YR4fkdmkQ== +"@vue/cli-shared-utils@^5.0.4", "@vue/cli-shared-utils@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@vue/cli-shared-utils/-/cli-shared-utils-5.0.8.tgz#75fc96528eba2b1c7e33cb7e989a984ddef99c8a" + integrity sha512-uK2YB7bBVuQhjOJF+O52P9yFMXeJVj7ozqJkwYE9PlMHL1LMHjtCYm4cSdOebuPzyP+/9p0BimM/OqxsevIopQ== dependencies: - "@achrinza/node-ipc" "9.2.2" + "@achrinza/node-ipc" "^9.2.5" chalk "^4.1.2" execa "^1.0.0" joi "^17.4.0" From cffa731106dafc84b273c5e75435b90db146a9a7 Mon Sep 17 00:00:00 2001 From: Andrew Jayne Date: Sun, 7 Aug 2022 20:51:45 +0100 Subject: [PATCH 004/213] fix: ingredient parsing for non-latin languages Before this change the ingredient string for non-latin languages was not being parsed into the correct amount or units when the food is found at the start of the ingredient string. This was because the regex being used was restricted to latin characters. With this change the amount and units are correctly parsed from such a string. Fixes https://github.com/TandoorRecipes/recipes/issues/1983 --- cookbook/helper/ingredient_parser.py | 4 ++-- cookbook/tests/other/test_ingredient_parser.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cookbook/helper/ingredient_parser.py b/cookbook/helper/ingredient_parser.py index 8a4fc30ac..468f1128f 100644 --- a/cookbook/helper/ingredient_parser.py +++ b/cookbook/helper/ingredient_parser.py @@ -221,8 +221,8 @@ class IngredientParser: # some people/languages put amount and unit at the end of the ingredient string # if something like this is detected move it to the beginning so the parser can handle it - if len(ingredient) < 1000 and re.search(r'^([A-z])+(.)*[1-9](\d)*\s([A-z])+', ingredient): - match = re.search(r'[1-9](\d)*\s([A-z])+', ingredient) + if len(ingredient) < 1000 and re.search(r'^([^\W\d_])+(.)*[1-9](\d)*\s*([^\W\d_])+', ingredient): + match = re.search(r'[1-9](\d)*\s*([^\W\d_])+', ingredient) print(f'reording from {ingredient} to {ingredient[match.start():match.end()] + " " + ingredient.replace(ingredient[match.start():match.end()], "")}') ingredient = ingredient[match.start():match.end()] + ' ' + ingredient.replace(ingredient[match.start():match.end()], '') diff --git a/cookbook/tests/other/test_ingredient_parser.py b/cookbook/tests/other/test_ingredient_parser.py index 90d5f0b79..d61cbc693 100644 --- a/cookbook/tests/other/test_ingredient_parser.py +++ b/cookbook/tests/other/test_ingredient_parser.py @@ -66,7 +66,9 @@ def test_ingredient_parser(): 1.0, 'Lorem', 'ipsum', 'dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut l Lorem ipsum dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut l'), "1 LoremipsumdolorsitametconsetetursadipscingelitrseddiamnonumyeirmodtemporinviduntutlLoremipsumdolorsitametconsetetursadipscingelitrseddiamnonumyeirmodtemporinviduntutl": ( 1.0, None, 'LoremipsumdolorsitametconsetetursadipscingelitrseddiamnonumyeirmodtemporinviduntutlLoremipsumdolorsitametconsetetursadipscingeli', - 'LoremipsumdolorsitametconsetetursadipscingelitrseddiamnonumyeirmodtemporinviduntutlLoremipsumdolorsitametconsetetursadipscingelitrseddiamnonumyeirmodtemporinviduntutl') + 'LoremipsumdolorsitametconsetetursadipscingelitrseddiamnonumyeirmodtemporinviduntutlLoremipsumdolorsitametconsetetursadipscingelitrseddiamnonumyeirmodtemporinviduntutl'), + "砂糖 50g": (50, "g", "砂糖", ""), + "卵 4個": (4, "個", "卵", "") } # for German you could say that if an ingredient does not have From 38921f125424faff01078e6b62fca866a3311197 Mon Sep 17 00:00:00 2001 From: Cameron Grant Date: Thu, 11 Aug 2022 14:23:31 -0700 Subject: [PATCH 005/213] Updated time to use hours and minutes split --- vue/src/apps/RecipeView/RecipeView.vue | 10 +++++++--- vue/src/components/RecipeCard.vue | 10 +++++++--- vue/src/utils/utils.js | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/vue/src/apps/RecipeView/RecipeView.vue b/vue/src/apps/RecipeView/RecipeView.vue index 4968f0b40..16b22e5d7 100644 --- a/vue/src/apps/RecipeView/RecipeView.vue +++ b/vue/src/apps/RecipeView/RecipeView.vue @@ -38,7 +38,7 @@
{{ $t("Preparation") }}
- {{ recipe.working_time }} {{ $t("min") }} + {{ working_time }}
@@ -50,7 +50,7 @@
{{ $t("Waiting") }}
- {{ recipe.waiting_time }} {{ $t("min") }} + {{ waiting_time }}
@@ -160,7 +160,7 @@ import "bootstrap-vue/dist/bootstrap-vue.css" import {apiLoadRecipe} from "@/utils/api" import RecipeContextMenu from "@/components/RecipeContextMenu" -import {ResolveUrlMixin, ToastMixin} from "@/utils/utils" +import {ResolveUrlMixin, ToastMixin, calculateHourMinuteSplit} from "@/utils/utils" import PdfViewer from "@/components/PdfViewer" import ImageViewer from "@/components/ImageViewer" @@ -206,6 +206,10 @@ export default { ingredient_count() { return this.recipe?.steps.map((x) => x.ingredients).flat().length }, + working_time: function() { + return calculateHourMinuteSplit(this.recipe.working_time)}, + waiting_time: function() { + return calculateHourMinuteSplit(this.recipe.waiting_time)}, }, data() { return { diff --git a/vue/src/components/RecipeCard.vue b/vue/src/components/RecipeCard.vue index 80cbcdb25..13a68a366 100755 --- a/vue/src/components/RecipeCard.vue +++ b/vue/src/components/RecipeCard.vue @@ -8,8 +8,8 @@
- {{ recipe.working_time }} {{ $t("min") }} - {{ recipe.waiting_time }} {{ $t("min") }} + {{ working_time }} + {{ waiting_time }}
@@ -59,7 +59,7 @@ diff --git a/cookbook/views/views.py b/cookbook/views/views.py index 1343a88de..8dfa1bc98 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -215,7 +215,6 @@ def shopping_settings(request): if request.method == "POST": if 'search_form' in request.POST: - active_tab = 'search' search_form = SearchPreferenceForm(request.POST, prefix='search') if search_form.is_valid(): if not sp: @@ -226,7 +225,28 @@ def shopping_settings(request): + len(search_form.cleaned_data['trigram']) + len(search_form.cleaned_data['fulltext']) ) - if fields_searched == 0: + if search_form.cleaned_data['preset'] == 'fuzzy': + sp.search = SearchPreference.SIMPLE + sp.lookup = True + sp.unaccent.set([SearchFields.objects.get(name='Name')]) + sp.icontains.set([SearchFields.objects.get(name='Name')]) + sp.istartswith.clear() + sp.trigram.set([SearchFields.objects.get(name='Name')]) + sp.fulltext.clear() + sp.trigram_threshold = 0.2 + sp.save() + elif search_form.cleaned_data['preset'] == 'precise': + sp.search = SearchPreference.WEB + sp.lookup = True + sp.unaccent.set(SearchFields.objects.all()) + # full text on food is very slow, add search_vector field and index it (including Admin functions and postsave signal to rebuild index) + sp.icontains.set([SearchFields.objects.get(name='Name')]) + sp.istartswith.set([SearchFields.objects.get(name='Name')]) + sp.trigram.clear() + sp.fulltext.set(SearchFields.objects.filter(name__in=['Ingredients'])) + sp.trigram_threshold = 0.2 + sp.save() + elif fields_searched == 0: search_form.add_error(None, _('You must select at least one field to search!')) search_error = True elif search_form.cleaned_data['search'] in ['websearch', 'raw'] and len( @@ -247,29 +267,9 @@ def shopping_settings(request): sp.trigram.set(search_form.cleaned_data['trigram']) sp.fulltext.set(search_form.cleaned_data['fulltext']) sp.trigram_threshold = search_form.cleaned_data['trigram_threshold'] - - if search_form.cleaned_data['preset'] == 'fuzzy': - sp.search = SearchPreference.SIMPLE - sp.lookup = True - sp.unaccent.set([SearchFields.objects.get(name='Name')]) - sp.icontains.set([SearchFields.objects.get(name='Name')]) - sp.istartswith.clear() - sp.trigram.set([SearchFields.objects.get(name='Name')]) - sp.fulltext.clear() - sp.trigram_threshold = 0.2 - - if search_form.cleaned_data['preset'] == 'precise': - sp.search = SearchPreference.WEB - sp.lookup = True - sp.unaccent.set(SearchFields.objects.all()) - # full text on food is very slow, add search_vector field and index it (including Admin functions and postsave signal to rebuild index) - sp.icontains.set([SearchFields.objects.get(name='Name')]) - sp.istartswith.set([SearchFields.objects.get(name='Name')]) - sp.trigram.clear() - sp.fulltext.set(SearchFields.objects.filter(name__in=['Ingredients'])) - sp.trigram_threshold = 0.2 - sp.save() + else: + search_error = True fields_searched = len(sp.icontains.all()) + len(sp.istartswith.all()) + len(sp.trigram.all()) + len( sp.fulltext.all()) @@ -281,10 +281,10 @@ def shopping_settings(request): # these fields require postgresql - just disable them if postgresql isn't available if not settings.DATABASES['default']['ENGINE'] in ['django.db.backends.postgresql_psycopg2', 'django.db.backends.postgresql']: - search_form.fields['search'].disabled = True - search_form.fields['lookup'].disabled = True - search_form.fields['trigram'].disabled = True - search_form.fields['fulltext'].disabled = True + sp.search = SearchPreference.SIMPLE + sp.trigram.clear() + sp.fulltext.clear() + sp.save() return render(request, 'settings.html', { 'search_form': search_form, From 13b91e5b91c42da9e29b1d22405b982a8b31e2ad Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 23 Sep 2022 16:27:16 +0200 Subject: [PATCH 074/213] improved swiping behavior on shopping list --- vue/src/components/ShoppingLineItem.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/vue/src/components/ShoppingLineItem.vue b/vue/src/components/ShoppingLineItem.vue index ee57c92c4..b1e52f7f6 100644 --- a/vue/src/components/ShoppingLineItem.vue +++ b/vue/src/components/ShoppingLineItem.vue @@ -31,12 +31,12 @@ - {{ Object.entries(formatAmount)[0][1] }} {{ Object.entries(formatAmount)[0][0] }} -
{{ x[1] }}   @@ -44,11 +44,10 @@
- + {{ formatFood }} - @@ -62,7 +61,7 @@
- From 12a8582a9a3295a63748a0f16fa7d2f2680de503 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 23 Sep 2022 16:43:22 +0200 Subject: [PATCH 075/213] fixed importer and copy recipe --- cookbook/helper/recipe_url_import.py | 2 +- cookbook/serializer.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index cec57e729..2ed85b082 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -21,7 +21,7 @@ def get_from_scraper(scrape, request): # converting the scrape_me object to the existing json format based on ld+json recipe_json = {} try: - recipe_json['name'] = parse_name(scrape.title() or None) + recipe_json['name'] = parse_name(scrape.title()[:128] or None) except Exception: recipe_json['name'] = None if not recipe_json['name']: diff --git a/cookbook/serializer.py b/cookbook/serializer.py index d10e334d7..d58b504d5 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -709,7 +709,7 @@ class RecipeOverviewSerializer(RecipeBaseSerializer): class Meta: model = Recipe fields = ( - 'id', 'name', 'description', 'image', 'keywords', 'working_time', + 'id', 'name', 'description', 'image', 'keywords', 'working_time', 'waiting_time', 'created_by', 'created_at', 'updated_at', 'internal', 'servings', 'servings_text', 'rating', 'last_cooked', 'new', 'recent' ) @@ -721,8 +721,8 @@ class RecipeSerializer(RecipeBaseSerializer): steps = StepSerializer(many=True) keywords = KeywordSerializer(many=True) shared = UserSerializer(many=True, required=False) - rating = CustomDecimalField(required=False, allow_null=True) - last_cooked = serializers.DateTimeField(required=False, allow_null=True) + rating = CustomDecimalField(required=False, allow_null=True, read_only=True) + last_cooked = serializers.DateTimeField(required=False, allow_null=True, read_only=True) class Meta: model = Recipe @@ -1124,14 +1124,14 @@ class AccessTokenSerializer(serializers.ModelSerializer): token = serializers.SerializerMethodField('get_token') def create(self, validated_data): - validated_data['token'] = f'tda_{str(uuid.uuid4()).replace("-","_")}' + validated_data['token'] = f'tda_{str(uuid.uuid4()).replace("-", "_")}' validated_data['user'] = self.context['request'].user return super().create(validated_data) def get_token(self, obj): if (timezone.now() - obj.created).seconds < 15: return obj.token - return f'tda_************_******_***********{obj.token[len(obj.token)-4:]}' + return f'tda_************_******_***********{obj.token[len(obj.token) - 4:]}' class Meta: model = AccessToken From 36c30f9e11c8fd8c0e8ae50d96cb8bc2b99680b6 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 23 Sep 2022 16:55:25 +0200 Subject: [PATCH 076/213] fixed print from card when recipe is not open --- vue/src/apps/RecipeView/RecipeView.vue | 2 +- vue/src/components/RecipeCard.vue | 11 +++++----- vue/src/components/RecipeContextMenu.vue | 26 ++++++++++++++---------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/vue/src/apps/RecipeView/RecipeView.vue b/vue/src/apps/RecipeView/RecipeView.vue index 16b22e5d7..470b84716 100644 --- a/vue/src/apps/RecipeView/RecipeView.vue +++ b/vue/src/apps/RecipeView/RecipeView.vue @@ -75,7 +75,7 @@
- +

diff --git a/vue/src/components/RecipeCard.vue b/vue/src/components/RecipeCard.vue index 17bfb2da2..b6cac11ce 100755 --- a/vue/src/components/RecipeCard.vue +++ b/vue/src/components/RecipeCard.vue @@ -3,15 +3,15 @@ + :footer_icon="isRecentOrNew(r)[1]" + :use_plural="use_plural"> + @@ -913,6 +916,7 @@ import LoadingSpinner from "@/components/LoadingSpinner" // TODO: is this deprec import RecipeCard from "@/components/RecipeCard" import GenericMultiselect from "@/components/GenericMultiselect" import RecipeSwitcher from "@/components/Buttons/RecipeSwitcher" +import { ApiApiFactory } from "@/utils/openapi/api" Vue.use(VueCookies) Vue.use(BootstrapVue) @@ -933,7 +937,7 @@ export default { meal_plans: [], last_viewed_recipes: [], sortMenu: false, - + use_plural: false, search: { advanced_search_visible: false, explain_visible: false, @@ -1160,6 +1164,10 @@ export default { this.loadMealPlan() this.refreshData(false) }) + let apiClient = new ApiApiFactory() + apiClient.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => { + this.use_plural = r.data.use_plural + }) this.$i18n.locale = window.CUSTOM_LOCALE this.debug = localStorage.getItem("DEBUG") == "True" || false }, diff --git a/vue/src/apps/SpaceManageView/SpaceManageView.vue b/vue/src/apps/SpaceManageView/SpaceManageView.vue index 3f03b0dc6..3deb39cbc 100644 --- a/vue/src/apps/SpaceManageView/SpaceManageView.vue +++ b/vue/src/apps/SpaceManageView/SpaceManageView.vue @@ -151,6 +151,9 @@ Facet Count {{ $t('facet_count_info') }}
+ Use Plural form + {{ $t('plural_usage_info') }}
+ { + apiFactory.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => { this.space = r.data }) apiFactory.listUserSpaces().then(r => { @@ -249,7 +252,7 @@ export default { }, updateSpace: function () { let apiFactory = new ApiApiFactory() - apiFactory.partialUpdateSpace(this.ACTIVE_SPACE_ID, this.space).then(r => { + apiFactory.partialUpdateSpace(window.ACTIVE_SPACE_ID, this.space).then(r => { StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE) }).catch(err => { StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err) diff --git a/vue/src/components/CookbookSlider.vue b/vue/src/components/CookbookSlider.vue index 83865c853..0a07bd587 100644 --- a/vue/src/components/CookbookSlider.vue +++ b/vue/src/components/CookbookSlider.vue @@ -12,7 +12,7 @@ - +
@@ -20,7 +20,7 @@ - +
@@ -34,7 +34,7 @@ import CookbookEditCard from "./CookbookEditCard" import CookbookToc from "./CookbookToc" import Vue2TouchEvents from "vue2-touch-events" import Vue from "vue" -import { ApiApiFactory } from "../utils/openapi/api" +import { ApiApiFactory } from "@/utils/openapi/api" Vue.use(Vue2TouchEvents) @@ -56,6 +56,12 @@ export default { return this.recipes.slice((this.current_page - 1 - 1) * 2, (this.current_page - 1) * 2) } }, + mounted(){ + let apiClient = new ApiApiFactory() + apiClient.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => { + this.use_plural = r.data.use_plural + }) + }, data() { return { current_page: 1, @@ -63,6 +69,7 @@ export default { bounce_left: false, bounce_right: false, cookbook_editing: false, + use_plural: false, } }, methods: { diff --git a/vue/src/components/GenericHorizontalCard.vue b/vue/src/components/GenericHorizontalCard.vue index ddf6f499c..6c01630f7 100644 --- a/vue/src/components/GenericHorizontalCard.vue +++ b/vue/src/components/GenericHorizontalCard.vue @@ -23,7 +23,9 @@
{{ item[title] }}
-
({{ $t("plural_short") }}: {{ item[plural] }})
+
{{ item[subtitle] }}
{{ getFullname }}
@@ -72,7 +74,11 @@
- +
@@ -154,6 +160,7 @@ export default { recipe_count: { type: String, default: "numrecipe" }, recipes: { type: String, default: "recipes" }, show_context_menu: { type: Boolean, default: true }, + use_plural: { type: Boolean, default: false}, }, data() { return { diff --git a/vue/src/components/IngredientComponent.vue b/vue/src/components/IngredientComponent.vue index 4278e0499..cbb7c91be 100644 --- a/vue/src/components/IngredientComponent.vue +++ b/vue/src/components/IngredientComponent.vue @@ -17,13 +17,18 @@ @@ -121,6 +125,7 @@ export default { props: { recipe: Object, meal_plan: Object, + use_plural: { type: Boolean, default: false}, footer_text: String, footer_icon: String, detailed: {type: Boolean, default: true}, diff --git a/vue/src/locales/ar.json b/vue/src/locales/ar.json index 2c3e51dcc..98cd23aa9 100644 --- a/vue/src/locales/ar.json +++ b/vue/src/locales/ar.json @@ -431,5 +431,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/bg.json b/vue/src/locales/bg.json index 6f7c772ea..65ed30b4e 100644 --- a/vue/src/locales/bg.json +++ b/vue/src/locales/bg.json @@ -416,5 +416,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/da.json b/vue/src/locales/da.json index 54572f5e6..9aec5deab 100644 --- a/vue/src/locales/da.json +++ b/vue/src/locales/da.json @@ -464,5 +464,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/de.json b/vue/src/locales/de.json index 7a0a0f21f..a93bef65a 100644 --- a/vue/src/locales/de.json +++ b/vue/src/locales/de.json @@ -466,5 +466,6 @@ "Use_Plural_Unit_Always": "Pluralform der Maßeinheit immer verwenden", "Use_Plural_Unit_Simple": "Pluralform der Maßeinheit dynamisch anpassen", "Use_Plural_Food_Always": "Pluralform des Essens immer verwenden", - "Use_Plural_Food_Simple": "Pluralform des Essens dynamisch anpassen" + "Use_Plural_Food_Simple": "Pluralform des Essens dynamisch anpassen", + "plural_usage_info": "Pluralform für Einheiten und Essen in diesem Space verwenden." } diff --git a/vue/src/locales/en.json b/vue/src/locales/en.json index 591156da6..4eca3ddae 100644 --- a/vue/src/locales/en.json +++ b/vue/src/locales/en.json @@ -465,5 +465,6 @@ "Use_Plural_Unit_Always": "Use plural form for unit always", "Use_Plural_Unit_Simple": "Use plural form for unit dynamically", "Use_Plural_Food_Always": "Use plural form for food always", - "Use_Plural_Food_Simple": "Use plural form for food dynamically" + "Use_Plural_Food_Simple": "Use plural form for food dynamically", + "plural_usage_info": "Use the plural form for units and food inside this space." } diff --git a/vue/src/locales/es.json b/vue/src/locales/es.json index ba17ba6a8..5e8fc8ed1 100644 --- a/vue/src/locales/es.json +++ b/vue/src/locales/es.json @@ -442,5 +442,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/fi.json b/vue/src/locales/fi.json index a76523d20..0f24fce8f 100644 --- a/vue/src/locales/fi.json +++ b/vue/src/locales/fi.json @@ -218,5 +218,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/fr.json b/vue/src/locales/fr.json index 4f66cd080..062cde013 100644 --- a/vue/src/locales/fr.json +++ b/vue/src/locales/fr.json @@ -408,5 +408,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/hu.json b/vue/src/locales/hu.json index 5d626d761..ae527f449 100644 --- a/vue/src/locales/hu.json +++ b/vue/src/locales/hu.json @@ -418,5 +418,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/hy.json b/vue/src/locales/hy.json index 9f0e42f3f..2ff2fdb4b 100644 --- a/vue/src/locales/hy.json +++ b/vue/src/locales/hy.json @@ -128,5 +128,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/it.json b/vue/src/locales/it.json index 7e29b5aa8..995e39e2a 100644 --- a/vue/src/locales/it.json +++ b/vue/src/locales/it.json @@ -352,5 +352,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/nl.json b/vue/src/locales/nl.json index 0576adad8..bbfa6d1e0 100644 --- a/vue/src/locales/nl.json +++ b/vue/src/locales/nl.json @@ -467,5 +467,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/pl.json b/vue/src/locales/pl.json index 3a02efc7a..3a3d3a192 100644 --- a/vue/src/locales/pl.json +++ b/vue/src/locales/pl.json @@ -466,5 +466,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/pt.json b/vue/src/locales/pt.json index a64243013..c745cb560 100644 --- a/vue/src/locales/pt.json +++ b/vue/src/locales/pt.json @@ -388,5 +388,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/pt_BR.json b/vue/src/locales/pt_BR.json index d3da898e4..84ed93510 100644 --- a/vue/src/locales/pt_BR.json +++ b/vue/src/locales/pt_BR.json @@ -393,5 +393,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/ro.json b/vue/src/locales/ro.json index ab4560837..9c2cc6ab6 100644 --- a/vue/src/locales/ro.json +++ b/vue/src/locales/ro.json @@ -212,5 +212,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/ru.json b/vue/src/locales/ru.json index 1740b8fb0..f4bb9baf4 100644 --- a/vue/src/locales/ru.json +++ b/vue/src/locales/ru.json @@ -348,5 +348,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/sl.json b/vue/src/locales/sl.json index 1908fdab5..e27a74747 100644 --- a/vue/src/locales/sl.json +++ b/vue/src/locales/sl.json @@ -290,5 +290,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/sv.json b/vue/src/locales/sv.json index 5a39f1def..25c4c7e4e 100644 --- a/vue/src/locales/sv.json +++ b/vue/src/locales/sv.json @@ -386,5 +386,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/uk.json b/vue/src/locales/uk.json index 5d626d761..ae527f449 100644 --- a/vue/src/locales/uk.json +++ b/vue/src/locales/uk.json @@ -418,5 +418,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/zh_Hans.json b/vue/src/locales/zh_Hans.json index 7d1dbb6b2..a20a8413c 100644 --- a/vue/src/locales/zh_Hans.json +++ b/vue/src/locales/zh_Hans.json @@ -465,5 +465,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } diff --git a/vue/src/locales/zh_Hant.json b/vue/src/locales/zh_Hant.json index f94a8ce05..cda8efe3b 100644 --- a/vue/src/locales/zh_Hant.json +++ b/vue/src/locales/zh_Hant.json @@ -83,5 +83,6 @@ "Use_Plural_Unit_Always": "", "Use_Plural_Unit_Simple": "", "Use_Plural_Food_Always": "", - "Use_Plural_Food_Simple": "" + "Use_Plural_Food_Simple": "", + "plural_usage_info": "" } From c97bb900a3f9c5f0ce3c2e3bc9ff2fd73819ab83 Mon Sep 17 00:00:00 2001 From: Niklas Schwarz Date: Tue, 1 Nov 2022 14:23:02 +0100 Subject: [PATCH 166/213] Add documentation page for the space settings --- docs/system/settings.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/system/settings.md diff --git a/docs/system/settings.md b/docs/system/settings.md new file mode 100644 index 000000000..990090fd8 --- /dev/null +++ b/docs/system/settings.md @@ -0,0 +1,27 @@ +Following is a description of the different settings for a space + +!!! WARNING WIP + Some settings and especially this page is work in Progress and the settings may + behave differently the described here. + +## Use Plural form + +Default Value: `off` + +This setting enables tandoor to display a plural form of a food or unit, if the +plural version is entered for the food or unit. The plural version is displayed if the +amount needed for a recipe is greater than 1 and will be adjusted to the current amount. + +In addition, this setting enables two new settings for an ingredient: + +- Always show the plural version of the food: This will always display the plural version for +a food, even if the amount is below or equal to 1. Requirement for this setting to activate +is a plural version available in the database. +- Always show the plural version of the unit: This will always display the plural version for +a unit, even if the amount is below or equal to 1. Requirement for this setting to activate +is a plural version available in the database. + +!!! WARNING Note + This setting is only meant to be a very simple version to enable some kind of pluralization + for food and units. This feature may not meet your needs, but pluralization is a difficult + topic and was discussed [here](https://github.com/TandoorRecipes/recipes/pull/1860). From 2e5571f0a9ed8260039cadc986c5567a2e73da7d Mon Sep 17 00:00:00 2001 From: Niklas Schwarz Date: Tue, 1 Nov 2022 14:24:20 +0100 Subject: [PATCH 167/213] Fix naming of exported SpaceManageView --- vue/src/apps/SpaceManageView/SpaceManageView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vue/src/apps/SpaceManageView/SpaceManageView.vue b/vue/src/apps/SpaceManageView/SpaceManageView.vue index 3deb39cbc..75167cb09 100644 --- a/vue/src/apps/SpaceManageView/SpaceManageView.vue +++ b/vue/src/apps/SpaceManageView/SpaceManageView.vue @@ -207,7 +207,7 @@ Vue.use(VueClipboard) Vue.use(BootstrapVue) export default { - name: "SupermarketView", + name: "SpaceManageView", mixins: [ResolveUrlMixin, ToastMixin, ApiMixin], components: {GenericMultiselect, GenericModalForm}, data() { From 3e2988f998ba0828063e49364f5626d63c003a6d Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 13 Nov 2022 13:24:13 +0100 Subject: [PATCH 168/213] Revert "Fixed: ports are on the wrong service" --- docs/install/docker/plain/docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/install/docker/plain/docker-compose.yml b/docs/install/docker/plain/docker-compose.yml index c61e46885..2a3b7c3fd 100644 --- a/docs/install/docker/plain/docker-compose.yml +++ b/docs/install/docker/plain/docker-compose.yml @@ -13,8 +13,6 @@ services: image: vabene1111/recipes env_file: - ./.env - ports: - - 80:8080 volumes: - staticfiles:/opt/recipes/staticfiles - nginx_config:/opt/recipes/nginx/conf.d @@ -26,6 +24,7 @@ services: image: nginx:mainline-alpine restart: always ports: + - 80:80 env_file: - ./.env depends_on: From 8759e8dd7378613a07b6650f7525a291661f2284 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 13:49:56 +0000 Subject: [PATCH 169/213] Bump pillow from 9.2.0 to 9.3.0 Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.2.0 to 9.3.0. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/9.2.0...9.3.0) --- updated-dependencies: - dependency-name: pillow dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1e56421be..7df6115a1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ bleach-allowlist==1.0.3 gunicorn==20.1.0 lxml==4.9.1 Markdown==3.3.7 -Pillow==9.2.0 +Pillow==9.3.0 psycopg2-binary==2.9.3 python-dotenv==0.21.0 requests==2.28.1 From bdc64348397b62f987f16ddcc9bd9e5a15a20771 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 06:54:00 +0000 Subject: [PATCH 170/213] Bump markdown from 3.3.7 to 3.4.1 Bumps [markdown](https://github.com/Python-Markdown/markdown) from 3.3.7 to 3.4.1. - [Release notes](https://github.com/Python-Markdown/markdown/releases) - [Commits](https://github.com/Python-Markdown/markdown/compare/3.3.7...3.4.1) --- updated-dependencies: - dependency-name: markdown dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7df6115a1..fff7a8661 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ bleach==5.0.1 bleach-allowlist==1.0.3 gunicorn==20.1.0 lxml==4.9.1 -Markdown==3.3.7 +Markdown==3.4.1 Pillow==9.3.0 psycopg2-binary==2.9.3 python-dotenv==0.21.0 From 13e5fb41438a05e5760ea4aff72a8f77d0c43d55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 06:54:01 +0000 Subject: [PATCH 171/213] Bump psycopg2-binary from 2.9.3 to 2.9.5 Bumps [psycopg2-binary](https://github.com/psycopg/psycopg2) from 2.9.3 to 2.9.5. - [Release notes](https://github.com/psycopg/psycopg2/releases) - [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS) - [Commits](https://github.com/psycopg/psycopg2/commits) --- updated-dependencies: - dependency-name: psycopg2-binary dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7df6115a1..f0d2b7707 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,7 @@ gunicorn==20.1.0 lxml==4.9.1 Markdown==3.3.7 Pillow==9.3.0 -psycopg2-binary==2.9.3 +psycopg2-binary==2.9.5 python-dotenv==0.21.0 requests==2.28.1 six==1.16.0 From 20435450f3e36e522501ca0aee2aec83f23eb095 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 06:54:03 +0000 Subject: [PATCH 172/213] Bump loader-utils from 1.4.1 to 1.4.2 in /vue Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] --- vue/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vue/yarn.lock b/vue/yarn.lock index 053b5ebfd..47c1286b5 100644 --- a/vue/yarn.lock +++ b/vue/yarn.lock @@ -7297,9 +7297,9 @@ loader-runner@^4.1.0, loader-runner@^4.2.0: integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: - version "1.4.1" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.1.tgz#278ad7006660bccc4d2c0c1578e17c5c78d5c0e0" - integrity sha512-1Qo97Y2oKaU+Ro2xnDMR26g1BwMT29jNbem1EvcujW2jqt+j5COXyscjM7bLQkM9HaxI7pkWeW7gnI072yMI9Q== + version "1.4.2" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" + integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" From 5aecf7e61cdc2fca5e844c5ce3da404667985a8e Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 20 Nov 2022 18:48:13 +0000 Subject: [PATCH 173/213] Translated using Weblate (German) Currently translated at 100.0% (524 of 524 strings) Translation: Tandoor/Recipes Backend Translate-URL: http://translate.tandoor.dev/projects/tandoor/recipes-backend/de/ --- cookbook/locale/de/LC_MESSAGES/django.po | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/cookbook/locale/de/LC_MESSAGES/django.po b/cookbook/locale/de/LC_MESSAGES/django.po index 198f310f5..4eab5983f 100644 --- a/cookbook/locale/de/LC_MESSAGES/django.po +++ b/cookbook/locale/de/LC_MESSAGES/django.po @@ -15,8 +15,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-12 19:20+0200\n" -"PO-Revision-Date: 2022-09-10 19:32+0000\n" -"Last-Translator: David Schenk \n" +"PO-Revision-Date: 2022-11-21 19:09+0000\n" +"Last-Translator: Alex \n" "Language-Team: German \n" "Language: de\n" @@ -24,7 +24,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.10.1\n" +"X-Generator: Weblate 4.14.1\n" #: .\cookbook\filters.py:23 .\cookbook\templates\forms\ingredients.html:34 #: .\cookbook\templates\stats.html:28 @@ -736,7 +736,7 @@ msgstr "Lebensmittel" #: .\cookbook\models.py:1229 .\cookbook\templates\base.html:138 msgid "Keyword" -msgstr "Schlagwort" +msgstr "Schlüsselwort" #: .\cookbook\serializer.py:207 msgid "Cannot modify Space owner permission." @@ -801,11 +801,10 @@ msgstr "" "Zutaten hinzugefügt." #: .\cookbook\serializer.py:1213 -#, fuzzy msgid "" "Providing a list_recipe ID and servings of 0 will delete that shopping list." msgstr "" -"Wenn Sie eine \"list_recipe\"-ID, sowie 0 Portionen angeben, wird diese " +"Wenn Sie eine list_recipe ID und Portion mit dem Wert 0 angeben, wird diese " "Einkaufsliste gelöscht." #: .\cookbook\serializer.py:1222 @@ -2777,8 +2776,6 @@ msgid "Bad URL Schema." msgstr "Ungültiges URL Schema." #: .\cookbook\views\api.py:1195 -#, fuzzy -#| msgid "No useable data could be found." msgid "No usable data could be found." msgstr "Es konnten keine nutzbaren Daten gefunden werden." From 39ccf7bbcf5758d45d246dc53d61097f2147f456 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 22 Nov 2022 07:58:12 +0100 Subject: [PATCH 174/213] added plural migration and pass param trough in recipe view --- ...redient_always_use_plural_food_and_more.py | 38 +++++++++++++++++++ vue/src/apps/ModelListView/ModelListView.vue | 3 +- vue/src/apps/RecipeView/RecipeView.vue | 11 +++++- vue/src/components/IngredientComponent.vue | 4 +- vue/src/components/StepComponent.vue | 7 +++- 5 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 cookbook/migrations/0185_food_plural_name_ingredient_always_use_plural_food_and_more.py diff --git a/cookbook/migrations/0185_food_plural_name_ingredient_always_use_plural_food_and_more.py b/cookbook/migrations/0185_food_plural_name_ingredient_always_use_plural_food_and_more.py new file mode 100644 index 000000000..f29ec9d28 --- /dev/null +++ b/cookbook/migrations/0185_food_plural_name_ingredient_always_use_plural_food_and_more.py @@ -0,0 +1,38 @@ +# Generated by Django 4.0.8 on 2022-11-22 06:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0184_alter_userpreference_image'), + ] + + operations = [ + migrations.AddField( + model_name='food', + name='plural_name', + field=models.CharField(blank=True, default=None, max_length=128, null=True), + ), + migrations.AddField( + model_name='ingredient', + name='always_use_plural_food', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='ingredient', + name='always_use_plural_unit', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='space', + name='use_plural', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='unit', + name='plural_name', + field=models.CharField(blank=True, default=None, max_length=128, null=True), + ), + ] diff --git a/vue/src/apps/ModelListView/ModelListView.vue b/vue/src/apps/ModelListView/ModelListView.vue index 4be8b693c..37d417c9b 100644 --- a/vue/src/apps/ModelListView/ModelListView.vue +++ b/vue/src/apps/ModelListView/ModelListView.vue @@ -23,8 +23,7 @@ - +
diff --git a/vue/src/apps/RecipeView/RecipeView.vue b/vue/src/apps/RecipeView/RecipeView.vue index 2b1e3b9b8..53386c084 100644 --- a/vue/src/apps/RecipeView/RecipeView.vue +++ b/vue/src/apps/RecipeView/RecipeView.vue @@ -90,6 +90,7 @@ :ingredient_factor="ingredient_factor" :servings="servings" :header="true" + :use_plural="use_plural" id="ingredient_container" @checked-state-changed="updateIngredientCheckedState" @change-servings="servings = $event" @@ -123,6 +124,7 @@ :step="s" :ingredient_factor="ingredient_factor" :index="index" + :use_plural="use_plural" :start_time="start_time" @update-start-time="updateStartTime" @checked-state-changed="updateIngredientCheckedState" @@ -179,6 +181,7 @@ import KeywordsComponent from "@/components/KeywordsComponent" import NutritionComponent from "@/components/NutritionComponent" import RecipeSwitcher from "@/components/Buttons/RecipeSwitcher" import CustomInputSpinButton from "@/components/CustomInputSpinButton" +import {ApiApiFactory} from "@/utils/openapi/api"; Vue.prototype.moment = moment @@ -218,6 +221,7 @@ export default { }, data() { return { + use_plural: false, loading: true, recipe: undefined, rootrecipe: undefined, @@ -226,7 +230,7 @@ export default { start_time: "", share_uid: window.SHARE_UID, wake_lock: null, - ingredient_height: '250' + ingredient_height: '250', } }, watch: { @@ -239,6 +243,11 @@ export default { this.$i18n.locale = window.CUSTOM_LOCALE this.requestWakeLock() window.addEventListener('resize', this.handleResize); + + let apiClient = new ApiApiFactory() + apiClient.retrieveSpace(window.ACTIVE_SPACE_ID).then(r => { + this.use_plural = r.data.use_plural + }) }, beforeUnmount() { this.destroyWakeLock() diff --git a/vue/src/components/IngredientComponent.vue b/vue/src/components/IngredientComponent.vue index cbb7c91be..cb5de51ce 100644 --- a/vue/src/components/IngredientComponent.vue +++ b/vue/src/components/IngredientComponent.vue @@ -18,11 +18,11 @@