2018-07-14 18:23:41 +02:00
@ extends ( 'layout.default' )
2019-05-01 20:19:18 +02:00
@ section ( 'title' , $__t ( 'Recipes' ))
2018-07-14 18:23:41 +02:00
@ section ( 'activeNav' , 'recipes' )
@ section ( 'viewJsName' , 'recipes' )
@ section ( 'content' )
2019-09-16 09:35:20 +02:00
< script >
Grocy . QuantityUnits = { !! json_encode ( $quantityUnits ) !! };
Grocy . QuantityUnitConversionsResolved = { !! json_encode ( $quantityUnitConversionsResolved ) !! };
</ script >
2018-07-14 18:23:41 +02:00
< div class = " row " >
2018-10-06 11:43:46 +02:00
< div class = " col-xs-12 col-md-6 pb-3 " >
2018-07-14 18:23:41 +02:00
< h1 >
@ yield ( 'title' )
< a class = " btn btn-outline-dark " href = " { { $U ('/recipe/new') }} " >
2019-05-01 20:19:18 +02:00
< i class = " fas fa-plus " ></ i > {{ $__t ( 'Add' ) }}
2018-07-14 18:23:41 +02:00
</ a >
</ h1 >
2019-05-03 19:22:58 +02:00
< div class = " row " >
< div class = " col-6 " >
< label for = " search " > {{ $__t ( 'Search' ) }} </ label > < i class = " fas fa-search " ></ i >
< input type = " text " class = " form-control " id = " search " >
</ div >
< div class = " col-6 " >
< label for = " status-filter " > {{ $__t ( 'Filter by status' ) }} </ label > < i class = " fas fa-filter " ></ i >
< select class = " form-control " id = " status-filter " >
< option class = " bg-white " value = " all " > {{ $__t ( 'All' ) }} </ option >
< option class = " bg-success " value = " enoughtinstock " > {{ $__t ( 'Enough in stock' ) }} </ option >
< option class = " bg-warning " value = " enoughinstockwithshoppinglist " > {{ $__t ( 'Not enough in stock, but already on the shopping list' ) }} </ option >
< option class = " bg-danger " value = " notenoughinstock " > {{ $__t ( 'Not enough in stock' ) }} </ option >
</ select >
</ div >
</ div >
2018-07-14 18:23:41 +02:00
2019-03-05 17:59:33 +01:00
< ul class = " nav nav-tabs mt-3 " >
< li class = " nav-item " >
2019-05-01 20:19:18 +02:00
< a class = " nav-link active " id = " list-tab " data - toggle = " tab " href = " #list " > {{ $__t ( 'List' ) }} </ a >
2019-03-05 17:59:33 +01:00
</ li >
< li class = " nav-item " >
2019-05-01 20:19:18 +02:00
< a class = " nav-link " id = " gallery-tab " data - toggle = " tab " href = " #gallery " > {{ $__t ( 'Gallery' ) }} </ a >
2019-03-05 17:59:33 +01:00
</ li >
</ ul >
< div class = " tab-content " >
< div class = " tab-pane show active " id = " list " >
< table id = " recipes-table " class = " table table-striped dt-responsive " >
< thead >
< tr >
2019-05-01 20:19:18 +02:00
< th > {{ $__t ( 'Name' ) }} </ th >
< th > {{ $__t ( 'Servings' ) }} </ th >
< th > {{ $__t ( 'Requirements fulfilled' ) }} </ th >
2019-03-05 17:59:33 +01:00
< th class = " d-none " > Hidden status for sorting of " Requirements fulfilled " column </ th >
2019-05-03 19:22:58 +02:00
< th class = " d-none " > Hidden status for filtering by status </ th >
2019-09-20 13:37:53 +02:00
< th class = " d-none " > Hidden recipe ingredient product names </ th >
2019-04-23 09:06:18 +02:00
@ include ( 'components.userfields_thead' , array (
'userfields' => $userfields
))
2019-03-05 17:59:33 +01:00
</ tr >
</ thead >
< tbody class = " d-none " >
@ foreach ( $recipes as $recipe )
< tr id = " recipe-row- { { $recipe->id }} " data - recipe - id = " { { $recipe->id }} " >
< td >
{{ $recipe -> name }}
</ td >
2019-03-09 10:49:26 +01:00
< td >
2019-03-05 17:59:33 +01:00
{{ $recipe -> desired_servings }}
</ td >
< td >
2019-03-05 23:45:04 +01:00
@ if ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> need_fulfilled == 1 ) < i class = " fas fa-check text-success " ></ i >@ elseif ( FindObjectInArrayByPropertyValue ( $recipesResolved , '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
2019-05-02 20:20:18 +02:00
< span class = " timeago-contextual " >@ if ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> need_fulfilled == 1 ){{ $__t ( 'Enough in stock' ) }} @ elseif ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> need_fulfilled_with_shopping_list == 1 ){{ $__n ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> missing_products_count , 'Not enough in stock, %s ingredient missing but already on the shopping list' , 'Not enough in stock, %s ingredients missing but already on the shopping list' ) }} @ else {{ $__n ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> missing_products_count , 'Not enough in stock, %s ingredient missing' , 'Not enough in stock, %s ingredients missing' ) }} @ endif </ span >
2019-03-05 17:59:33 +01:00
</ td >
< td class = " d-none " >
2019-03-05 23:45:04 +01:00
{{ FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> missing_products_count }}
2019-03-05 17:59:33 +01:00
</ td >
2019-05-03 19:22:58 +02:00
< td class = " d-none " >
@ if ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> need_fulfilled == 1 ) enoughtinstock @ elseif ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> need_fulfilled_with_shopping_list == 1 ) enoughinstockwithshoppinglist @ else notenoughinstock @ endif
</ td >
2019-09-20 13:37:53 +02:00
< td class = " d-none " >
@ foreach ( FindAllObjectsInArrayByPropertyValue ( $recipePositionsResolved , 'recipe_id' , $recipe -> id ) as $recipePos )
{{ FindObjectInArrayByPropertyValue ( $products , 'id' , $recipePos -> product_id ) -> name . ' ' }}
@ endforeach
</ td >
2019-04-23 09:06:18 +02:00
@ include ( 'components.userfields_tbody' , array (
'userfields' => $userfields ,
'userfieldValues' => FindAllObjectsInArrayByPropertyValue ( $userfieldValues , 'object_id' , $recipe -> id )
))
2019-03-05 17:59:33 +01:00
</ tr >
@ endforeach
</ tbody >
</ table >
</ div >
< div class = " tab-pane show " id = " gallery " >
< div class = " row no-gutters " >
@ foreach ( $recipes as $recipe )
2019-03-05 19:17:10 +01:00
< div class = " col-6 recipe-gallery-item-container " >
2019-03-05 17:59:33 +01:00
< a class = " discrete-link recipe-gallery-item " data - recipe - id = " { { $recipe->id }} " href = " # " >
2019-03-05 19:17:10 +01:00
< div id = " recipe-card- { { $recipe->id }} " class = " card border-white mb-0 recipe-card " >
2019-03-05 17:59:33 +01:00
@ if ( ! empty ( $recipe -> picture_file_name ))
2019-09-18 13:59:37 +02:00
< img data - src = " { { $U ('/api/files/recipepictures/' . base64_encode( $recipe->picture_file_name ) . '?force_serve_as=picture&best_fit_width=400') }} " class = " img-fluid lazy " >
2019-03-05 17:59:33 +01:00
@ endif
< div class = " card-body text-center " >
< h5 class = " card-title mb-1 " > {{ $recipe -> name }} </ h5 >
< p class = " card-text " >
2019-03-05 23:45:04 +01:00
@ if ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> need_fulfilled == 1 ) < i class = " fas fa-check text-success " ></ i >@ elseif ( FindObjectInArrayByPropertyValue ( $recipesResolved , '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
2019-05-03 19:51:08 +02:00
< span class = " timeago-contextual " >@ if ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> need_fulfilled == 1 ){{ $__t ( 'Enough in stock' ) }} @ elseif ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> need_fulfilled_with_shopping_list == 1 ){{ $__n ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> missing_products_count , 'Not enough in stock, %s ingredient missing but already on the shopping list' , 'Not enough in stock, %s ingredients missing but already on the shopping list' ) }} @ else {{ $__n ( FindObjectInArrayByPropertyValue ( $recipesResolved , 'recipe_id' , $recipe -> id ) -> missing_products_count , 'Not enough in stock, %s ingredient missing' , 'Not enough in stock, %s ingredients missing' ) }} @ endif </ span >
2019-03-05 17:59:33 +01:00
</ p >
</ div >
</ div >
</ a >
</ div >
2018-07-14 18:23:41 +02:00
@ endforeach
2019-03-05 17:59:33 +01:00
</ div >
</ div >
</ div >
2018-07-14 18:23:41 +02:00
</ div >
2018-07-15 09:56:10 +02:00
@ if ( $selectedRecipe !== null )
< div class = " col-xs-12 col-md-6 " >
2019-09-26 23:33:08 -07:00
< div class = " card-header " >
< i class = " fas fa-cocktail " ></ i > {{ $selectedRecipe -> name }} & nbsp ; & nbsp ;
< a id = " selectedRecipeConsumeButton " class = " btn btn-sm btn-outline-success py-0 hide-when-embedded hide-on-fullscreen-card @if(FindObjectInArrayByPropertyValue( $recipesResolved , 'recipe_id', $selectedRecipe->id )->need_fulfilled == 0) disabled @endif " href = " # " data - toggle = " tooltip " title = " { { $__t ('Consume all ingredients needed by this recipe') }} " data - recipe - id = " { { $selectedRecipe->id }} " data - recipe - name = " { { $selectedRecipe->name }} " >
< i class = " fas fa-utensils " ></ i >
</ a >
< a class = " btn btn-sm btn-outline-primary py-0 recipe-order-missing-button hide-when-embedded hide-on-fullscreen-card @if(FindObjectInArrayByPropertyValue( $recipesResolved , 'recipe_id', $selectedRecipe->id )->need_fulfilled_with_shopping_list == 1) disabled @endif " href = " # " data - toggle = " tooltip " title = " { { $__t ('Put missing products on shopping list') }} " data - recipe - id = " { { $selectedRecipe->id }} " data - recipe - name = " { { $selectedRecipe->name }} " >
< i class = " fas fa-cart-plus " ></ i >
</ a >& nbsp ; & nbsp ;
2020-01-21 20:45:34 +01:00
< a id = " selectedRecipeEditButton " class = " btn btn-sm btn-outline-info hide-when-embedded hide-on-fullscreen-card py-0 " href = " { { $U ('/recipe/') }} { { $selectedRecipe->id }} " >
2019-09-26 23:33:08 -07:00
< i class = " fas fa-edit " ></ i >
</ a >
< a id = " selectedRecipeDeleteButton " class = " btn btn-sm btn-outline-danger hide-when-embedded hide-on-fullscreen-card py-0 " href = " # " data - recipe - id = " { { $selectedRecipe->id }} " data - recipe - name = " { { $selectedRecipe->name }} " >
< i class = " fas fa-trash " ></ i >
</ a >
< a id = " selectedRecipeToggleFullscreenButton " class = " btn btn-sm btn-outline-secondary py-0 hide-when-embedded float-right " href = " # " data - toggle = " tooltip " title = " { { $__t ('Expand to fullscreen') }} " >
< i class = " fas fa-expand-arrows-alt " ></ i >
</ a >
</ div >
2018-07-15 09:56:10 +02:00
< div id = " selectedRecipeCard " class = " card " >
2019-03-03 16:33:48 +01:00
< div class = " card-body mb-0 pb-0 " >
< div class = " row " >
2019-09-20 20:06:24 +02:00
< div class = " col-4 " >
2019-03-03 16:33:48 +01:00
@ include ( 'components.numberpicker' , array (
'id' => 'servings-scale' ,
'label' => 'Servings' ,
'min' => 1 ,
'value' => $selectedRecipe -> desired_servings ,
2019-05-01 20:19:18 +02:00
'invalidFeedback' => $__t ( 'This cannot be lower than %s' , '1' ),
2019-03-03 16:33:48 +01:00
'additionalAttributes' => 'data-recipe-id="' . $selectedRecipe -> id . '"'
))
</ div >
2019-09-21 13:08:42 +02:00
@ if ( ! empty ( $selectedRecipeTotalCalories ) && intval ( $selectedRecipeTotalCalories ) > 0 )
2019-09-20 20:06:24 +02:00
< div class = " col-2 " >
< label > {{ $__t ( 'Energy (kcal)' ) }} </ label >
2019-09-21 08:38:28 +02:00
< p class = " mb-0 " >
2019-09-26 15:25:30 +02:00
< h3 class = " locale-number locale-number-generic pt-0 " > {{ $selectedRecipeTotalCalories }} </ h3 >
2019-09-20 20:06:24 +02:00
</ p >
</ div >
2019-09-21 13:08:42 +02:00
@ endif
2019-09-19 17:46:52 +02:00
@ if ( GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING )
2019-09-20 20:06:24 +02:00
< div class = " col-6 " >
2019-05-01 20:19:18 +02:00
< label > {{ $__t ( 'Costs' ) }} & nbsp ; & nbsp ;
< span class = " small text-muted " > {{ $__t ( 'Based on the prices of the last purchase per product' ) }} </ span >
2019-03-03 16:33:48 +01:00
</ label >
2019-09-21 08:38:28 +02:00
< p class = " mb-0 " >
2019-09-26 15:25:30 +02:00
< h3 class = " locale-number locale-number-currency pt-0 " > {{ $selectedRecipeTotalCosts }} </ h3 >
2019-03-03 16:33:48 +01:00
</ p >
</ div >
2019-09-19 17:46:52 +02:00
@ endif
2019-03-03 16:33:48 +01:00
</ div >
2019-03-03 13:27:10 +01:00
</ div >
2018-10-25 20:36:29 +02:00
<!-- Subrecipes first -->
@ foreach ( $selectedRecipeSubRecipes as $selectedRecipeSubRecipe )
< div class = " card-body " >
< h3 class = " mb-0 " > {{ $selectedRecipeSubRecipe -> name }} </ h3 >
</ div >
2019-01-26 20:06:01 +01:00
@ if ( ! empty ( $selectedRecipeSubRecipe -> picture_file_name ))
2019-09-18 13:59:37 +02:00
< p class = " w-75 mx-auto txt-center " >< img src = " { { $U ('/api/files/recipepictures/' . base64_encode( $selectedRecipeSubRecipe->picture_file_name ) . '?force_serve_as=picture&best_fit_width=400') }} " class = " img-fluid img-thumbnail lazy " ></ p >
2019-01-26 20:06:01 +01:00
@ endif
2019-03-05 23:45:04 +01:00
@ php $selectedRecipeSubRecipePositionsFiltered = FindAllObjectsInArrayByPropertyValue ( $selectedRecipeSubRecipesPositions , 'child_recipe_id' , $selectedRecipeSubRecipe -> id ); @ endphp
2018-10-25 20:36:29 +02:00
@ if ( count ( $selectedRecipeSubRecipePositionsFiltered ) > 0 )
< div class = " card-body " >
2019-05-01 20:19:18 +02:00
< h5 class = " mb-0 " > {{ $__t ( 'Ingredients' ) }} </ h5 >
2018-10-25 20:36:29 +02:00
</ div >
< ul class = " list-group list-group-flush " >
2018-10-27 10:37:31 +02:00
@ php $lastGroup = 'undefined' ; @ endphp
2018-10-25 20:36:29 +02:00
@ foreach ( $selectedRecipeSubRecipePositionsFiltered as $selectedRecipePosition )
2018-10-27 10:37:31 +02:00
@ if ( $lastGroup != $selectedRecipePosition -> ingredient_group )
< h5 class = " mb-2 mt-2 ml-4 " >< strong > {{ $selectedRecipePosition -> ingredient_group }} </ strong ></ h5 >
@ endif
2018-10-25 20:36:29 +02:00
< li class = " list-group-item " >
2019-09-16 09:35:20 +02:00
@ php
$product = FindObjectInArrayByPropertyValue ( $products , 'id' , $selectedRecipePosition -> product_id );
$productQuConversions = FindAllObjectsInArrayByPropertyValue ( $quantityUnitConversionsResolved , 'product_id' , $product -> id );
$productQuConversions = FindAllObjectsInArrayByPropertyValue ( $productQuConversions , 'from_qu_id' , $product -> qu_id_stock );
$productQuConversion = FindObjectInArrayByPropertyValue ( $productQuConversions , 'to_qu_id' , $selectedRecipePosition -> qu_id );
if ( $productQuConversion )
{
$selectedRecipePosition -> recipe_amount = $selectedRecipePosition -> recipe_amount * $productQuConversion -> factor ;
}
@ endphp
2019-05-04 14:50:15 +02:00
@ if ( ! empty ( $selectedRecipePosition -> recipe_variable_amount ))
{{ $selectedRecipePosition -> recipe_variable_amount }}
@ else
2019-09-26 15:25:30 +02:00
< span class = " llocale-number locale-number-quantity-amount " >@ if ( $selectedRecipePosition -> recipe_amount == round ( $selectedRecipePosition -> recipe_amount , 2 )){{ round ( $selectedRecipePosition -> recipe_amount , 2 ) }} @ else {{ $selectedRecipePosition -> recipe_amount }} @ endif </ span >
2019-05-04 14:50:15 +02:00
@ endif
2019-09-18 13:59:37 +02:00
{{ $__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 }}
2019-03-06 19:05:32 +01:00
@ if ( $selectedRecipePosition -> need_fulfilled == 1 ) < i class = " fas fa-check text-success " ></ i >@ elseif ( $selectedRecipePosition -> need_fulfilled_with_shopping_list == 1 ) < i class = " fas fa-exclamation text-warning " ></ i >@ else < i class = " fas fa-times text-danger " ></ i >@ endif
2019-05-05 14:13:50 +02:00
< span class = " timeago-contextual " >@ 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 </ span >
2018-10-25 20:36:29 +02:00
@ if ( ! empty ( $selectedRecipePosition -> note ))
2018-10-27 10:39:52 +02:00
< div class = " text-muted " > { !! nl2br ( $selectedRecipePosition -> note ) !! } </ div >
2018-10-25 20:36:29 +02:00
@ endif
</ li >
2018-10-27 10:37:31 +02:00
@ php $lastGroup = $selectedRecipePosition -> ingredient_group ; @ endphp
2018-10-25 20:36:29 +02:00
@ endforeach
</ ul >
@ endif
@ if ( ! empty ( $selectedRecipeSubRecipe -> description ))
< div class = " card-body " >
2019-05-01 20:19:18 +02:00
< h5 > {{ $__t ( 'Preparation' ) }} </ h5 >
2018-10-25 20:36:29 +02:00
{ !! $selectedRecipeSubRecipe -> description !! }
</ div >
@ endif
@ endforeach
<!-- Selected recipe -->
2019-01-26 20:06:01 +01:00
@ if ( ! empty ( $selectedRecipe -> picture_file_name ))
2019-09-18 13:59:37 +02:00
< p class = " w-75 mx-auto text-center " >< img src = " { { $U ('/api/files/recipepictures/' . base64_encode( $selectedRecipe->picture_file_name ) . '?force_serve_as=picture&best_fit_width=400') }} " class = " img-fluid img-thumbnail lazy " ></ p >
2019-01-26 20:06:01 +01:00
@ endif
2019-03-05 23:45:04 +01:00
@ if ( $selectedRecipePositionsResolved -> count () > 0 )
2018-07-15 09:56:10 +02:00
< div class = " card-body " >
2019-05-01 20:19:18 +02:00
< h5 class = " mb-0 " > {{ $__t ( 'Ingredients' ) }} </ h5 >
2018-07-15 09:56:10 +02:00
</ div >
< ul class = " list-group list-group-flush " >
2018-10-25 22:45:44 +02:00
@ php $lastGroup = 'undefined' ; @ endphp
2019-03-05 23:45:04 +01:00
@ foreach ( $selectedRecipePositionsResolved as $selectedRecipePosition )
2018-10-25 22:45:44 +02:00
@ if ( $lastGroup != $selectedRecipePosition -> ingredient_group )
2018-10-27 10:37:31 +02:00
< h5 class = " mb-2 mt-2 ml-4 " >< strong > {{ $selectedRecipePosition -> ingredient_group }} </ strong ></ h5 >
2018-10-25 22:45:44 +02:00
@ endif
2018-07-15 09:56:10 +02:00
< li class = " list-group-item " >
2019-09-16 09:35:20 +02:00
@ php
$product = FindObjectInArrayByPropertyValue ( $products , 'id' , $selectedRecipePosition -> product_id );
$productQuConversions = FindAllObjectsInArrayByPropertyValue ( $quantityUnitConversionsResolved , 'product_id' , $product -> id );
$productQuConversions = FindAllObjectsInArrayByPropertyValue ( $productQuConversions , 'from_qu_id' , $product -> qu_id_stock );
$productQuConversion = FindObjectInArrayByPropertyValue ( $productQuConversions , 'to_qu_id' , $selectedRecipePosition -> qu_id );
if ( $productQuConversion )
{
$selectedRecipePosition -> recipe_amount = $selectedRecipePosition -> recipe_amount * $productQuConversion -> factor ;
}
@ endphp
2019-05-04 14:50:15 +02:00
@ if ( ! empty ( $selectedRecipePosition -> recipe_variable_amount ))
{{ $selectedRecipePosition -> recipe_variable_amount }}
@ else
2019-09-26 15:25:30 +02:00
< span class = " locale-number locale-number-quantity-amount " >@ if ( $selectedRecipePosition -> recipe_amount == round ( $selectedRecipePosition -> recipe_amount , 2 )){{ round ( $selectedRecipePosition -> recipe_amount , 2 ) }} @ else {{ $selectedRecipePosition -> recipe_amount }} @ endif </ span >
2019-05-04 14:50:15 +02:00
@ endif
2019-09-18 13:59:37 +02:00
{{ $__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 }}
2019-03-06 19:05:32 +01:00
@ if ( $selectedRecipePosition -> need_fulfilled == 1 ) < i class = " fas fa-check text-success " ></ i >@ elseif ( $selectedRecipePosition -> need_fulfilled_with_shopping_list == 1 ) < i class = " fas fa-exclamation text-warning " ></ i >@ else < i class = " fas fa-times text-danger " ></ i >@ endif
2019-05-05 14:13:50 +02:00
< span class = " timeago-contextual " >@ 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 </ span >
2018-07-15 13:33:59 +02:00
@ if ( ! empty ( $selectedRecipePosition -> note ))
2018-10-27 10:39:52 +02:00
< div class = " text-muted " > { !! nl2br ( $selectedRecipePosition -> note ) !! } </ div >
2018-07-15 13:33:59 +02:00
@ endif
2018-07-15 09:56:10 +02:00
</ li >
2018-10-25 22:45:44 +02:00
@ php $lastGroup = $selectedRecipePosition -> ingredient_group ; @ endphp
2018-07-15 09:56:10 +02:00
@ endforeach
</ ul >
2018-10-25 20:36:29 +02:00
@ endif
@ if ( ! empty ( $selectedRecipe -> description ))
2018-07-15 09:56:10 +02:00
< div class = " card-body " >
2019-05-01 20:19:18 +02:00
< h5 > {{ $__t ( 'Preparation' ) }} </ h5 >
2018-10-03 16:41:21 +02:00
{ !! $selectedRecipe -> description !! }
2018-07-15 09:56:10 +02:00
</ div >
2018-10-25 20:36:29 +02:00
@ endif
2018-07-15 09:56:10 +02:00
</ div >
</ div >
@ endif
2018-07-14 18:23:41 +02:00
</ div >
2019-03-03 14:49:46 +01:00
< div id = " missing-recipe-pos-list " class = " list-group d-none mt-3 " >
2019-03-05 23:45:04 +01:00
@ foreach ( $recipePositionsResolved as $recipePos )
2019-03-03 14:57:36 +01:00
@ if ( in_array ( $recipePos -> recipe_id , $includedRecipeIdsAbsolute ) && $recipePos -> missing_amount > 0 )
2019-03-03 14:49:46 +01:00
< a href = " # " class = " list-group-item list-group-item-action list-group-item-primary missing-recipe-pos-select-button " >
< div class = " form-check form-check-inline " >
< input class = " form-check-input missing-recipe-pos-product-checkbox " type = " checkbox " data - product - id = " { { $recipePos->product_id }} " checked >
</ div >
{{ FindObjectInArrayByPropertyValue ( $products , 'id' , $recipePos -> product_id ) -> name }}
</ a >
@ endif
@ endforeach
</ div >
2018-07-14 18:23:41 +02:00
@ stop