Optimized recipeposform input ordering (closes #533)

This commit is contained in:
Bernd Bestel 2020-02-01 08:59:37 +01:00
parent b8c6ac6905
commit 55c5501d96
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 13 additions and 10 deletions

View File

@ -3,3 +3,6 @@
### Shopping list fixes ### Shopping list fixes
- Optimized the new compact view (there was a little too much white space at the sides of the page) - Optimized the new compact view (there was a little too much white space at the sides of the page)
### Recipe improvements
- Optimized the ordering of the inputs on the recipe ingredient edit page (moved "Only check if a single unit is in stock" before the amount)

View File

@ -33,6 +33,16 @@
'nextInputSelector' => '#amount' 'nextInputSelector' => '#amount'
)) ))
<div class="row">
<div class="col">
<div class="form-check form-group mb-1">
<input type="hidden" name="only_check_single_unit_in_stock" value="0">
<input @if($mode == 'edit' && $recipePos->only_check_single_unit_in_stock == 1) checked @endif class="form-check-input" type="checkbox" id="only_check_single_unit_in_stock" name="only_check_single_unit_in_stock" value="1">
<label class="form-check-label" for="only_check_single_unit_in_stock">{{ $__t('Only check if a single unit is in stock (a different quantity can then be used above)') }}</label>
</div>
</div>
</div>
@php if($mode == 'edit') { $value = $recipePos->amount; } else { $value = 1; } @endphp @php if($mode == 'edit') { $value = $recipePos->amount; } else { $value = 1; } @endphp
@php if($mode == 'edit') { $initialQuId = $recipePos->qu_id; } else { $initialQuId = ''; } @endphp @php if($mode == 'edit') { $initialQuId = $recipePos->qu_id; } else { $initialQuId = ''; } @endphp
@include('components.productamountpicker', array( @include('components.productamountpicker', array(
@ -41,16 +51,6 @@
'additionalGroupCssClasses' => 'mb-0' 'additionalGroupCssClasses' => 'mb-0'
)) ))
<div class="row">
<div class="col">
<div class="form-check form-group">
<input type="hidden" name="only_check_single_unit_in_stock" value="0">
<input @if($mode == 'edit' && $recipePos->only_check_single_unit_in_stock == 1) checked @endif class="form-check-input" type="checkbox" id="only_check_single_unit_in_stock" name="only_check_single_unit_in_stock" value="1">
<label class="form-check-label" for="only_check_single_unit_in_stock">{{ $__t('Only check if a single unit is in stock (a different quantity can then be used above)') }}</label>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label for="variable_amount">{{ $__t('Variable amount') }}&nbsp;&nbsp;<span class="small text-muted">{{ $__t('When this is not empty, it will be shown instead of the amount entered above while the amount there will still be used for stock fulfillment checking') }}</span></label> <label for="variable_amount">{{ $__t('Variable amount') }}&nbsp;&nbsp;<span class="small text-muted">{{ $__t('When this is not empty, it will be shown instead of the amount entered above while the amount there will still be used for stock fulfillment checking') }}</span></label>
<input type="text" class="form-control" id="variable_amount" name="variable_amount" value="@if($mode == 'edit'){{ $recipePos->variable_amount }}@endif"> <input type="text" class="form-control" id="variable_amount" name="variable_amount" value="@if($mode == 'edit'){{ $recipePos->variable_amount }}@endif">