Implemented scalable recipes (closes #127)

This commit is contained in:
Bernd Bestel
2019-03-03 13:27:10 +01:00
parent ee38d626aa
commit 89ad25c904
6 changed files with 131 additions and 32 deletions

View File

@@ -22,6 +22,7 @@
<thead>
<tr>
<th>{{ $L('Name') }}</th>
<th class="fit-content text-right">{{ $L('Servings') }}</th>
<th>{{ $L('Requirements fulfilled') }}</th>
<th class="d-none">Hidden status for sorting of "Requirements fulfilled" column</th>
</tr>
@@ -32,6 +33,9 @@
<td>
{{ $recipe->name }}
</td>
<td class="fit-content text-right">
{{ $recipe->desired_servings }}
</td>
<td>
@if(FindObjectInArrayByPropertyValue($recipesSumFulfillment, 'recipe_id', $recipe->id)->need_fulfilled == 1)<i class="fas fa-check text-success"></i>@elseif(FindObjectInArrayByPropertyValue($recipesSumFulfillment, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1)<i class="fas fa-exclamation text-warning"></i>@else<i class="fas fa-times text-danger"></i>@endif
<span class="timeago-contextual">@if(FindObjectInArrayByPropertyValue($recipesSumFulfillment, 'recipe_id', $recipe->id)->need_fulfilled == 1){{ $L('Enough in stock') }}@elseif(FindObjectInArrayByPropertyValue($recipesSumFulfillment, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1){{ $L('Not enough in stock, #1 ingredients missing but already on the shopping list', FindObjectInArrayByPropertyValue($recipesSumFulfillment, 'recipe_id', $recipe->id)->missing_products_count) }}@else{{ $L('Not enough in stock, #1 ingredients missing', FindObjectInArrayByPropertyValue($recipesSumFulfillment, 'recipe_id', $recipe->id)->missing_products_count) }}@endif</span>
@@ -67,6 +71,19 @@
</a>
</div>
<div class="card-body">
@include('components.numberpicker', array(
'id' => 'servings-scale',
'label' => 'Servings',
'min' => 1,
'value' => $selectedRecipe->desired_servings,
'invalidFeedback' => $L('This cannot be lower than #1', '1'),
'additionalGroupCssClasses' => 'mb-0',
'additionalCssClasses' => 'col-2',
'additionalAttributes' => 'data-recipe-id="' . $selectedRecipe->id . '"'
))
</div>
<!-- Subrecipes first -->
@foreach($selectedRecipeSubRecipes as $selectedRecipeSubRecipe)
<div class="card-body">