Modularize product picker

This commit is contained in:
Bernd Bestel
2018-07-14 14:43:57 +02:00
parent aa0771877f
commit 71fc49252f
10 changed files with 239 additions and 328 deletions

View File

@@ -11,17 +11,10 @@
<form id="inventory-form" novalidate>
<div class="form-group">
<label for="product_id">{{ $L('Product') }}&nbsp;&nbsp;<i class="fas fa-barcode"></i><span id="barcode-lookup-disabled-hint" class="small text-muted d-none">&nbsp;&nbsp;{{ $L('Barcode lookup is disabled') }}</span></label>
<select class="form-control combobox" id="product_id" name="product_id" required>
<option value=""></option>
@foreach($products as $product)
<option data-additional-searchdata="{{ $product->barcode }}" value="{{ $product->id }}">{{ $product->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $L('You have to select a product') }}</div>
<div id="flow-info-addbarcodetoselection" class="form-text text-muted small d-none"><strong><span id="addbarcodetoselection"></span></strong> {{ $L('will be added to the list of barcodes for the selected product on submit') }}</div>
</div>
@include('components.productpicker', array(
'products' => $products,
'nextInputSelector' => '#new_amount'
))
<div class="form-group">
<label for="new_amount">{{ $L('New amount') }}&nbsp;&nbsp;<span id="new_amount_qu_unit" class="small text-muted"></span></label>