@extends('layout.default') @if($mode == 'edit') @section('title', $__t('Edit recipe')) @else @section('title', $__t('Create recipe')) @endif @section('viewJsName', 'recipeform') @push('pageScripts') @endpush @push('pageStyles') @endpush @section('content')

@yield('title')

@if($mode == 'edit') @if(!empty($recipe->picture_file_name)) @endif @endif
{{ $__t('A name is required') }}
@php if($mode == 'edit') { $value = $recipe->base_servings; } else { $value = 1; } @endphp @include('components.numberpicker', array( 'id' => 'base_servings', 'label' => 'Servings', 'min' => 1, 'value' => $value, 'invalidFeedback' => $__t('This cannot be lower than %s', '1'), 'hint' => $__t('The ingredients listed here result in this amount of servings') ))
not_check_shoppinglist == 1) checked @endif class="form-check-input" type="checkbox" id="not_check_shoppinglist" name="not_check_shoppinglist" value="1">
@include('components.productpicker', array( 'products' => $products, 'isRequired' => false, 'label' => 'Produces product', 'prefillById' => $recipe->product_id, 'hint' => $__t('When a product is selected, one unit (per serving in purchase quantity unit) will be added to stock on consuming this recipe') )) @include('components.userfieldsform', array( 'userfields' => $userfields, 'entity' => 'recipes' ))

{{ $__t('Ingredients list') }} {{ $__t('Add') }}

@if($mode == "edit") @foreach($recipePositions as $recipePosition) @endforeach @endif
{{ $__t('Product') }} {{ $__t('Amount') }} {{ $__t('Note') }} Hiden ingredient group
{{ FindObjectInArrayByPropertyValue($products, 'id', $recipePosition->product_id)->name }} @php $product = FindObjectInArrayByPropertyValue($products, 'id', $recipePosition->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', $recipePosition->qu_id); if ($productQuConversion) { $recipePosition->amount = $recipePosition->amount * $productQuConversion->factor; } @endphp @if(!empty($recipePosition->variable_amount)) {{ $recipePosition->variable_amount }} @else @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
{{ $recipePosition->ingredient_group }}

{{ $__t('Included recipes') }} {{ $__t('Add') }}

@if($mode == "edit") @foreach($recipeNestings as $recipeNesting) @endforeach @endif
{{ $__t('Recipe') }} {{ $__t('Servings') }}
{{ FindObjectInArrayByPropertyValue($recipes, 'id', $recipeNesting->includes_recipe_id)->name }} {{ $recipeNesting->servings }}
@if(!empty($recipe->picture_file_name))

{{ $__t('The current picture will be deleted when you save the recipe') }}

@else

{{ $__t('No picture available') }}

@endif
@stop