@extends('layout.default') @if($mode == 'edit') @section('title', $__t('Edit shopping list item')) @else @section('title', $__t('Create shopping list item')) @endif @section('viewJsName', 'shoppinglistitemform') @section('content')

@yield('title')


@if($mode == 'edit') @endif
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)
@else @endif
@php if($mode == 'edit') { $productId = $listItem->product_id; } else { $productId = ''; } @endphp @include('components.productpicker', array( 'products' => $products, 'nextInputSelector' => '#amount', 'isRequired' => true, 'prefillById' => $productId, 'validationMessage' => 'A product or a note is required' ))
@php if($mode == 'edit') { $value = $listItem->amount; } else { $value = 1; } @endphp @php if($mode == 'edit') { $initialQuId = $listItem->qu_id; } else { $initialQuId = ''; } @endphp @include('components.productamountpicker', array( 'value' => $value, 'initialQuId' => $initialQuId, 'min' => $DEFAULT_MIN_AMOUNT, 'isRequired' => false ))
{{ $__t('A product or a note is required') }}
@include('components.userfieldsform', array( 'userfields' => $userfields, 'entity' => 'shopping_list' ))
@stop