Finalize nested recipes / group recipe positions feature (closes #77)

This commit is contained in:
Bernd Bestel
2018-10-27 10:37:31 +02:00
parent 3e6cf545d7
commit da98efa833
7 changed files with 30 additions and 9 deletions

View File

@@ -75,7 +75,11 @@
<h5 class="mb-0">{{ $L('Ingredients') }}</h5>
</div>
<ul class="list-group list-group-flush">
@php $lastGroup = 'undefined'; @endphp
@foreach($selectedRecipeSubRecipePositionsFiltered as $selectedRecipePosition)
@if($lastGroup != $selectedRecipePosition->ingredient_group)
<h5 class="mb-2 mt-2 ml-4"><strong>{{ $selectedRecipePosition->ingredient_group }}</strong></h5>
@endif
<li class="list-group-item">
{{ $selectedRecipePosition->amount }} {{ Pluralize($selectedRecipePosition->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }}
<span class="timeago-contextual">@if(FindObjectInArrayByPropertyValue($recipesFulfillment, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $L('Enough in stock') }} @else {{ $L('Not enough in stock, #1 missing, #2 already on shopping list', FindObjectInArrayByPropertyValue($recipesFulfillment, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, FindObjectInArrayByPropertyValue($recipesFulfillment, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list) }} @endif</span>
@@ -84,6 +88,7 @@
<div class="text-muted">{{ $selectedRecipePosition->note }}</div>
@endif
</li>
@php $lastGroup = $selectedRecipePosition->ingredient_group; @endphp
@endforeach
</ul>
@endif
@@ -104,7 +109,7 @@
@php $lastGroup = 'undefined'; @endphp
@foreach($selectedRecipePositions as $selectedRecipePosition)
@if($lastGroup != $selectedRecipePosition->ingredient_group)
<h5 class="mb-2 mt-4 ml-4"><strong>{{ $selectedRecipePosition->ingredient_group }}</strong></h5>
<h5 class="mb-2 mt-2 ml-4"><strong>{{ $selectedRecipePosition->ingredient_group }}</strong></h5>
@endif
<li class="list-group-item">
{{ $selectedRecipePosition->amount }} {{ Pluralize($selectedRecipePosition->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }}