mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Implemented browser barcode scanning (closes #102)
This commit is contained in:
11
views/components/barcodescanner.blade.php
Normal file
11
views/components/barcodescanner.blade.php
Normal file
@@ -0,0 +1,11 @@
|
||||
@if (!GROCY_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING)
|
||||
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/barcodescanner.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
|
||||
@push('pageScripts')
|
||||
<script src="{{ $U('/node_modules/quagga/dist/quagga.min.js?v=', true) }}{{ $version }}"></script>
|
||||
@endpush
|
||||
|
||||
@endif
|
@@ -13,7 +13,7 @@
|
||||
|
||||
<div class="form-group" data-next-input-selector="{{ $nextInputSelector }}" data-disallow-add-product-workflows="{{ BoolToString($disallowAddProductWorkflows) }}" data-disallow-all-product-workflows="{{ BoolToString($disallowAllProductWorkflows) }}" data-prefill-by-name="{{ $prefillByName }}" data-prefill-by-id="{{ $prefillById }}">
|
||||
<label for="product_id">{{ $__t($label) }} <i class="fas fa-barcode"></i><span id="barcode-lookup-disabled-hint" class="small text-muted d-none"> {{ $__t('Barcode lookup is disabled') }}</span> <span class="small text-muted">{{ $hint }}</span></label>
|
||||
<select class="form-control product-combobox" id="product_id" name="product_id" @if($isRequired) required @endif @if($disabled) disabled @endif>
|
||||
<select class="form-control product-combobox barcodescanner-input" id="product_id" name="product_id" @if($isRequired) required @endif @if($disabled) disabled @endif>
|
||||
<option value=""></option>
|
||||
@foreach($products as $product)
|
||||
<option data-additional-searchdata="{{ $product->barcode }}" value="{{ $product->id }}">{{ $product->name }}</option>
|
||||
@@ -26,3 +26,5 @@
|
||||
@endif
|
||||
<div id="flow-info-addbarcodetoselection" class="form-text text-muted small d-none"><strong><span id="addbarcodetoselection"></span></strong> {{ $__t('will be added to the list of barcodes for the selected product on submit') }}</div>
|
||||
</div>
|
||||
|
||||
@include('components.barcodescanner')
|
||||
|
Reference in New Issue
Block a user