diff --git a/changelog/56_UNRELEASED_2020-xx-xx.md b/changelog/56_UNRELEASED_2020-xx-xx.md index da5aa385..2346bcb2 100644 --- a/changelog/56_UNRELEASED_2020-xx-xx.md +++ b/changelog/56_UNRELEASED_2020-xx-xx.md @@ -8,6 +8,7 @@ ### Recipe improvements/fixes - Optimized the ordering of the inputs on the recipe ingredient edit page (moved "Only check if a single unit is in stock" before the amount) +- Variable ingredient amounts are now marked accordingly on the renedered recipe - Fixed that when editing a recipe ingredient which had "Only check if a single unit is in stock" set, not any quantity unit could be picked and the amount stayed empty - Fixed that when reloading the "new recipe"-page (or when it gets auto-reloaded due to "Auto reload on external changes" is enabled), for each reload a new recipe was created diff --git a/views/recipeform.blade.php b/views/recipeform.blade.php index 6dba08ca..577c7d07 100644 --- a/views/recipeform.blade.php +++ b/views/recipeform.blade.php @@ -153,6 +153,10 @@ @if($recipePosition->amount == round($recipePosition->amount)){{ round($recipePosition->amount) }}@else{{ $recipePosition->amount }}@endif @endif {{ $__n($recipePosition->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $recipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $recipePosition->qu_id)->name_plural) }} + + @if(!empty($recipePosition->variable_amount)) +
{{ $__t('Variable amount') }}
+ @endif diff --git a/views/recipes.blade.php b/views/recipes.blade.php index 9574a9b3..6b473991 100644 --- a/views/recipes.blade.php +++ b/views/recipes.blade.php @@ -216,12 +216,16 @@ @if(!empty($selectedRecipePosition->recipe_variable_amount)) {{ $selectedRecipePosition->recipe_variable_amount }} @else - @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif + @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif @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 }} @if($selectedRecipePosition->need_fulfilled == 1)@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)@else@endif @if(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock, %1$s missing, %2$s already on shopping list', round(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, 2), round(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list, 2)) }} @endif + @if(!empty($selectedRecipePosition->recipe_variable_amount)) +
{{ $__t('Variable amount') }}
+ @endif + @if(!empty($selectedRecipePosition->note))
{!! nl2br($selectedRecipePosition->note) !!}
@endif @@ -273,6 +277,10 @@ @if($selectedRecipePosition->need_fulfilled == 1)@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)@else@endif @if(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock, %1$s missing, %2$s already on shopping list', round(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, 2), round(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list, 2)) }} @endif + @if(!empty($selectedRecipePosition->recipe_variable_amount)) +
{{ $__t('Variable amount') }}
+ @endif + @if(!empty($selectedRecipePosition->note))
{!! nl2br($selectedRecipePosition->note) !!}
@endif