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

@yield('title')

@if($mode == 'edit') @endif
{{ $L('A name is required') }}

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

@if($mode == "edit") @foreach($recipePositions as $recipePosition) @endforeach @endif
# {{ $L('Product') }} {{ $L('Amount') }} {{ $L('Note') }}
{{ FindObjectInArrayByPropertyValue($products, 'id', $recipePosition->product_id)->name }} {{ $recipePosition->amount }} {{ Pluralize($recipePosition->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', $recipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $recipePosition->qu_id)->name_plural) }} @if(FindObjectInArrayByPropertyValue($recipesFulfillment, 'recipe_pos_id', $recipePosition->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', $recipePosition->id)->missing_amount, FindObjectInArrayByPropertyValue($recipesFulfillment, 'recipe_pos_id', $recipePosition->id)->amount_on_shopping_list) }} @endif
@stop