From dea6f3f820f215907aa943331e0d3841220a1e20 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 24 Dec 2022 13:06:27 +0100 Subject: [PATCH] Replace also the unit when displaying a recipe ingredient with a variable amount (closes #2080) --- changelog/70_UNRELEASED_xxxx.xx.xx.md | 1 + views/recipes.blade.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog/70_UNRELEASED_xxxx.xx.xx.md b/changelog/70_UNRELEASED_xxxx.xx.xx.md index 49d0aa8b..b3e53ff2 100644 --- a/changelog/70_UNRELEASED_xxxx.xx.xx.md +++ b/changelog/70_UNRELEASED_xxxx.xx.xx.md @@ -18,6 +18,7 @@ ### Recipes +- Changed that when a ingredient has a "Variable amount" set, the text entered there now also replaces the unit when displaying the recipe (not only the amount as before) - Fixed that hiding the "Requirements fulfilled" column (table options) on the recipes page didn't work - Fixed that ingredient costs and calories were wrong when product substitution and unit conversions were involved at the same time diff --git a/views/recipes.blade.php b/views/recipes.blade.php index 422afe7e..abe07da5 100644 --- a/views/recipes.blade.php +++ b/views/recipes.blade.php @@ -494,8 +494,9 @@ {{ $selectedRecipePosition->recipe_variable_amount }} @else @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif + {{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} @endif - {{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }} + {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }} @if(GROCY_FEATURE_FLAG_STOCK)