mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 03:04:36 +00:00
Use the now available @once directive instead of the legacy hack to only include component scripts once
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
@if (!GROCY_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING)
|
||||
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/barcodescanner.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@once
|
||||
@push('pageScripts')
|
||||
<script src="{{ $U('/node_modules/@ericblade/quagga2/dist/quagga.min.js?v=', true) }}{{ $version }}"></script>
|
||||
<script src="{{ $U('/components_unmanaged/quagga2-reader-datamatrix/index.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@push('pageStyles')
|
||||
<style>
|
||||
@@ -22,6 +26,7 @@
|
||||
.combobox-container #barcodescanner-start-button {
|
||||
margin-right: 36px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/batterycard.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
<div class="card batterycard">
|
||||
<div class="card-header">
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/calendarcard.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/chorecard.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
<div class="card chorecard">
|
||||
<div class="card-header">
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/datetimepicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(!isset($isRequired)) { $isRequired = true; } @endphp
|
||||
@php if(!isset($initialValue)) { $initialValue = ''; } @endphp
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/datetimepicker2.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(!isset($isRequired)) { $isRequired = true; } @endphp
|
||||
@php if(!isset($initialValue)) { $initialValue = ''; } @endphp
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/locationpicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(empty($prefillByName)) { $prefillByName = ''; } @endphp
|
||||
@php if(empty($prefillById)) { $prefillById = ''; } @endphp
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/numberpicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(!isset($value)) { $value = 1; } @endphp
|
||||
@php if(empty($min)) { $min = 0; } @endphp
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/productamountpicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(empty($additionalGroupCssClasses)) { $additionalGroupCssClasses = ''; } @endphp
|
||||
@php if(empty($additionalHtmlContextHelp)) { $additionalHtmlContextHelp = ''; } @endphp
|
||||
|
@@ -1,7 +1,9 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/node_modules/chart.js/dist/Chart.min.js?v=', true) }}{{ $version }}"></script>
|
||||
<script src="{{ $U('/viewjs/components/productcard.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
<div class="card productcard">
|
||||
<div class="card-header">
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/productpicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(empty($disallowAddProductWorkflows)) { $disallowAddProductWorkflows = false; } @endphp
|
||||
@php if(empty($disallowAllProductWorkflows)) { $disallowAllProductWorkflows = false; } @endphp
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/recipepicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(empty($prefillByName)) { $prefillByName = ''; } @endphp
|
||||
@php if(empty($prefillById)) { $prefillById = ''; } @endphp
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/shoppinglocationpicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(empty($prefillByName)) { $prefillByName = ''; } @endphp
|
||||
@php if(empty($prefillById)) { $prefillById = ''; } @endphp
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/userfieldsform.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@if(count($userfields) > 0)
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
@once
|
||||
@push('componentScripts')
|
||||
<script src="{{ $U('/viewjs/components/userpicker.js', true) }}?v={{ $version }}"></script>
|
||||
@endpush
|
||||
@endonce
|
||||
|
||||
@php if(empty($prefillByUsername)) { $prefillByUsername = ''; } @endphp
|
||||
@php if(empty($prefillByUserId)) { $prefillByUserId = ''; } @endphp
|
||||
|
Reference in New Issue
Block a user