mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Fixed number input min/max amount handling Only (auto) save valid user inputs More filters on the stock journal pages Save the last price per used barcode and preselect that as a total price on purchase if not empty (closes #1131) Don't apply conversions for only_check_single_unit_in_stock ingredients (fixes #1120) Render shopping list userfields (closes #1052) Fixed Focus when adding included recipes (closes #1019) Order all base objects with NOCASE (closes #1086)
68 lines
2.5 KiB
PHP
68 lines
2.5 KiB
PHP
@push('componentScripts')
|
|
<script src="{{ $U('/viewjs/components/numberpicker.js', true) }}?v={{ $version }}"></script>
|
|
@endpush
|
|
|
|
@php if(!isset($value)) { $value = 1; } @endphp
|
|
@php if(empty($min)) { $min = 0; } @endphp
|
|
@php if(!isset($max)) { $max = ''; } @endphp
|
|
@php if(empty($decimals)) { $decimals = 0; } @endphp
|
|
@php if(empty($hint)) { $hint = ''; } @endphp
|
|
@php if(empty($hintId)) { $hintId = ''; } @endphp
|
|
@php if(empty($additionalCssClasses)) { $additionalCssClasses = ''; } @endphp
|
|
@php if(empty($additionalGroupCssClasses)) { $additionalGroupCssClasses = ''; } @endphp
|
|
@php if(empty($additionalAttributes)) { $additionalAttributes = ''; } @endphp
|
|
@php if(empty($additionalHtmlElements)) { $additionalHtmlElements = ''; } @endphp
|
|
@php if(empty($additionalHtmlContextHelp)) { $additionalHtmlContextHelp = ''; } @endphp
|
|
@php if(!isset($isRequired)) { $isRequired = true; } @endphp
|
|
@php if(!isset($noNameAttribute)) { $noNameAttribute = false; } @endphp
|
|
@php if(empty($contextInfoId)) { $additionalHtmlContextHelp = ''; } @endphp
|
|
@php if(!isset($invalidFeedback)) { $invalidFeedback = ''; } @endphp
|
|
|
|
<div id="group-{{ $id }}"
|
|
class="form-group {{ $additionalGroupCssClasses }}">
|
|
<label class="w-100"
|
|
for="{{ $id }}">
|
|
{{ $__t($label) }}
|
|
@if(!empty($hint) || !empty($hintId))
|
|
<i id="{{ $hintId }}"
|
|
class="fas fa-question-circle text-muted"
|
|
data-toggle="tooltip"
|
|
title="{{ $hint }}"></i>
|
|
@endif
|
|
{!! $additionalHtmlContextHelp !!}
|
|
@if(!empty($contextInfoId))
|
|
<span id="{{ $contextInfoId }}"
|
|
class="small text-muted float-right mt-1"></span>
|
|
@endif
|
|
</label>
|
|
<div class="input-group">
|
|
<input {!!
|
|
$additionalAttributes
|
|
!!}
|
|
type="number"
|
|
class="form-control numberpicker {{ $additionalCssClasses }}"
|
|
id="{{ $id }}"
|
|
@if(!$noNameAttribute)
|
|
name="{{ $id }}"
|
|
@endif
|
|
value="{{ $value }}"
|
|
min="{{ number_format($min, $decimals, '.', '') }}"
|
|
@if(!empty($max))
|
|
max="{{ number_format($max, $decimals, '.', '') }}"
|
|
@endif
|
|
step="@if($decimals == 0){{1}}@else{{'.' . str_repeat('0', $decimals - 1) . '1'}}@endif"
|
|
data-decimals="{{ $decimals }}"
|
|
@if($isRequired)
|
|
required
|
|
@endif>
|
|
<div class="input-group-append">
|
|
<div class="input-group-text numberpicker-up-button"><i class="fas fa-arrow-up"></i></div>
|
|
</div>
|
|
<div class="input-group-append">
|
|
<div class="input-group-text numberpicker-down-button"><i class="fas fa-arrow-down"></i></div>
|
|
</div>
|
|
<div class="invalid-feedback">{{ $invalidFeedback }}</div>
|
|
</div>
|
|
{!! $additionalHtmlElements !!}
|
|
</div>
|