Squashed commit

- Only refresh contextual number/datetime info/formatting where needed (closes #513)
- Also refresh correlated stock journal entries on undo (closes #471)
- Prefill "New amount" with the current stock amount on the inventory page (closes #434)
- Ensure that the location_id of the stock and stock_log tables is never empty after migration 95 (references #421)
- Load initial values of the /stockedit form server side to improve loading performance (references #421)
- Use more or less the same input ordering as on the purchase page for the /stockedit page (references #421)
- Also display the "Compact view" button on the shopping list page when FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS is disabled (references #453)
- Ensure that the currently active sidebar menu item is visible
- Optimized sidebar menu item grouping/spacing
- Properly order the API documentation route groups and put the "by-barcode" routes into a separate group
- Updated dependencies
- Pulled translations from Transifex
- Prepared changelog for next release
This commit is contained in:
Bernd Bestel
2020-01-27 19:00:49 +01:00
parent 9221d787a5
commit 05aceb72ae
74 changed files with 5506 additions and 1868 deletions

View File

@@ -39,7 +39,7 @@
</thead>
<tbody class="d-none">
@foreach($chargeCycles as $chargeCycleEntry)
<tr class="@if($chargeCycleEntry->undone == 1) text-muted @endif">
<tr id="charge-cycle-{{ $chargeCycleEntry->id }}-row" class="@if($chargeCycleEntry->undone == 1) text-muted @endif">
<td class="fit-content border-right">
<a class="btn btn-secondary btn-sm undo-battery-execution-button @if($chargeCycleEntry->undone == 1) disabled @endif" href="#" data-charge-cycle-id="{{ $chargeCycleEntry->id }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Undo charge cycle') }}">
<i class="fas fa-undo"></i>

View File

@@ -42,7 +42,7 @@
</thead>
<tbody class="d-none">
@foreach($choresLog as $choreLogEntry)
<tr class="@if($choreLogEntry->undone == 1) text-muted @endif">
<tr id="chore-execution-{{ $choreLogEntry->id }}-row" class="@if($choreLogEntry->undone == 1) text-muted @endif">
<td class="fit-content border-right">
<a class="btn btn-secondary btn-sm undo-chore-execution-button @if($choreLogEntry->undone == 1) disabled @endif" href="#" data-execution-id="{{ $choreLogEntry->id }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Undo chore execution') }}">
<i class="fas fa-undo"></i>

View File

@@ -2,7 +2,7 @@
<script src="{{ $U('/viewjs/components/batterycard.js', true) }}?v={{ $version }}"></script>
@endpush
<div class="card">
<div class="card batterycard">
<div class="card-header">
<i class="fas fa-battery-three-quarters"></i> {{ $__t('Battery overview') }}
<a id="batterycard-battery-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit battery') }}">

View File

@@ -2,7 +2,7 @@
<script src="{{ $U('/viewjs/components/chorecard.js', true) }}?v={{ $version }}"></script>
@endpush
<div class="card">
<div class="card chorecard">
<div class="card-header">
<i class="fas fa-home"></i> {{ $__t('Chore overview') }}
<a id="chorecard-chore-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit chore') }}">

View File

@@ -3,7 +3,7 @@
<script src="{{ $U('/viewjs/components/productcard.js', true) }}?v={{ $version }}"></script>
@endpush
<div class="card">
<div class="card productcard">
<div class="card-header">
<i class="fab fa-product-hunt"></i> {{ $__t('Product overview') }}
<a id="productcard-product-edit-button" class="btn btn-sm btn-outline-info py-0 float-right disabled" href="#" data-toggle="tooltip" title="{{ $__t('Edit product') }}">

View File

@@ -85,7 +85,7 @@
@if(GROCY_AUTHENTICATED)
<div id="sidebarResponsive" class="collapse navbar-collapse">
<ul class="navbar-nav navbar-sidenav pt-2">
<ul class="navbar-nav navbar-sidenav">
@if(GROCY_FEATURE_FLAG_STOCK)
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Stock overview') }}" data-nav-for-page="stockoverview">
@@ -104,14 +104,22 @@
</li>
@endif
@if(GROCY_FEATURE_FLAG_RECIPES)
<div class="nav-item-divider"></div>
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Recipes') }}" data-nav-for-page="recipes">
<a class="nav-link discrete-link" href="{{ $U('/recipes') }}">
<i class="fas fa-cocktail"></i>
<span class="nav-link-text">{{ $__t('Recipes') }}</span>
</a>
</li>
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Meal plan') }}" data-nav-for-page="mealplan">
<a class="nav-link discrete-link" href="{{ $U('/mealplan') }}">
<i class="fas fa-paper-plane"></i>
<span class="nav-link-text">{{ $__t('Meal plan') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_CHORES)
<div class="nav-item-divider"></div>
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Chores overview') }}" data-nav-for-page="choresoverview">
<a class="nav-link discrete-link" href="{{ $U('/choresoverview') }}">
<i class="fas fa-home"></i>
@@ -143,9 +151,19 @@
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_CALENDAR)
<div class="nav-item-divider"></div>
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Calendar') }}" data-nav-for-page="calendar">
<a class="nav-link discrete-link" href="{{ $U('/calendar') }}">
<i class="fas fa-calendar-alt"></i>
<span class="nav-link-text">{{ $__t('Calendar') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_STOCK)
<li class="nav-item mt-4" data-toggle="tooltip" data-placement="right" title="{{ $__t('Purchase') }}" data-nav-for-page="purchase">
<div class="nav-item-divider"></div>
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Purchase') }}" data-nav-for-page="purchase">
<a class="nav-link discrete-link" href="{{ $U('/purchase') }}">
<i class="fas fa-shopping-cart"></i>
<span class="nav-link-text">{{ $__t('Purchase') }}</span>
@@ -157,7 +175,7 @@
<span class="nav-link-text">{{ $__t('Consume') }}</span>
</a>
</li>
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Transfer') }}" data-nav-for-page="transfer">
<a class="nav-link discrete-link" href="{{ $U('/transfer') }}">
<i class="fas fa-exchange-alt"></i>
@@ -188,22 +206,6 @@
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_CALENDAR)
<li class="nav-item mt-4" data-toggle="tooltip" data-placement="right" title="{{ $__t('Calendar') }}" data-nav-for-page="calendar">
<a class="nav-link discrete-link" href="{{ $U('/calendar') }}">
<i class="fas fa-calendar-alt"></i>
<span class="nav-link-text">{{ $__t('Calendar') }}</span>
</a>
</li>
@endif
@if(GROCY_FEATURE_FLAG_RECIPES)
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Meal plan') }}" data-nav-for-page="mealplan">
<a class="nav-link discrete-link" href="{{ $U('/mealplan') }}">
<i class="fas fa-paper-plane"></i>
<span class="nav-link-text">{{ $__t('Meal plan') }}</span>
</a>
</li>
@endif
@php $firstUserentity = true; @endphp
@foreach($userentitiesForSidebar as $userentity)
@@ -216,7 +218,8 @@
@php if ($firstUserentity) { $firstUserentity = false; } @endphp
@endforeach
<li class="nav-item mt-4" data-toggle="tooltip" data-placement="right" title="{{ $__t('Manage master data') }}">
<div class="nav-item-divider"></div>
<li class="nav-item" data-toggle="tooltip" data-placement="right" title="{{ $__t('Manage master data') }}">
<a class="nav-link nav-link-collapse collapsed discrete-link" data-toggle="collapse" href="#top-nav-manager-master-data">
<i class="fas fa-table"></i>
<span class="nav-link-text">{{ $__t('Manage master data') }}</span>

View File

@@ -37,7 +37,7 @@
<a id="print-shopping-list-button" class="btn btn-outline-dark responsive-button" href="#">
<i class="fas fa-print"></i> {{ $__t('Print') }}
</a>
<a id="shopping-list-compact-view-button" class="btn btn-outline-dark responsive-button float-right switch-view-mode-button" href="#">
<a id="shopping-list-compact-view-button" class="btn btn-outline-dark responsive-button switch-view-mode-button" href="#">
<i class="fas fa-compress-arrows-alt"></i> {{ $__t('Compact view') }}
</a>
<!--<div class="dropdown d-inline-block">
@@ -68,6 +68,11 @@
<a id="add-all-items-to-stock-button" class="btn btn-outline-primary responsive-button" href="#">
<i class="fas fa-box"></i> {{ $__t('Add all list items to stock') }}
</a>
@if(!GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS)
<a id="shopping-list-compact-view-button" class="btn btn-outline-dark responsive-button switch-view-mode-button" href="#">
<i class="fas fa-compress-arrows-alt"></i> {{ $__t('Compact view') }}
</a>
@endif
</h1>
<p data-status-filter="belowminstockamount" class="btn btn-lg btn-info status-filter-button responsive-button">{{ $__n(count($missingProducts), '%s product is below defined min. stock amount', '%s products are below defined min. stock amount') }}</p>
</div>

View File

@@ -65,7 +65,7 @@
<i class="fas fa-box-open"></i>
</a>
@endif
<a class="btn btn-info btn-sm show-as-dialog-link" href="{{ $U('/stockedit?embedded&product=' . $currentStockEntry->product_id . '&stockRowId=' . $currentStockEntry->id) }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Edit stock entry') }}">
<a class="btn btn-info btn-sm show-as-dialog-link" href="{{ $U('/stockedit/' . $currentStockEntry->id . '?embedded') }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Edit stock entry') }}">
<i class="fas fa-edit"></i>
</a>
<div class="dropdown d-inline-block">

View File

@@ -5,30 +5,20 @@
@section('viewJsName', 'stockedit')
@section('content')
<script>
Grocy.EditObjectId = {{ $stockEntry->id }};
Grocy.EditObjectProductId = {{ $stockEntry->product_id }};
</script>
<div class="row">
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
<h1>@yield('title')</h1>
<form id="stockedit-form" novalidate>
@php
$product = FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id);
@endphp
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
@include('components.locationpicker', array(
'locations' => $locations
))
@else
<input type="hidden" name="location_id" id="location_id" value="1">
@endif
@include('components.numberpicker', array(
'id' => 'amount',
'label' => 'Amount',
'hintId' => 'amount_qu_unit',
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'additionalAttributes' => 'data-not-equal="-1"',
'additionalHtmlElements' => '<div id="stockedit-change-info" class="form-text text-muted small d-none"></div>',
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-small text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
@php
$additionalGroupCssClasses = '';
if (!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
@@ -38,6 +28,7 @@
@endphp
@include('components.datetimepicker', array(
'id' => 'best_before_date',
'initialValue' => $stockEntry->best_before_date,
'label' => 'Best before',
'format' => 'YYYY-MM-DD',
'initWithNow' => false,
@@ -54,13 +45,24 @@
))
@php $additionalGroupCssClasses = ''; @endphp
@include('components.numberpicker', array(
'id' => 'amount',
'value' => $stockEntry->amount,
'label' => 'Amount',
'hintId' => 'amount_qu_unit',
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'additionalAttributes' => 'data-not-equal="-1"',
'additionalHtmlElements' => '<div id="stockedit-change-info" class="form-text text-muted small d-none"></div>',
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-small text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
@include('components.numberpicker', array(
'id' => 'price',
'value' => $stockEntry->price,
'label' => 'Price',
'min' => 0,
'step' => 0.01,
'value' => '',
'hint' => $__t('in %s per purchase quantity unit', GROCY_CURRENCY),
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
'isRequired' => false
@@ -69,8 +71,18 @@
<input type="hidden" name="price" id="price" value="0">
@endif
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
@include('components.locationpicker', array(
'locations' => $locations,
'prefillById' => $stockEntry->location_id
))
@else
<input type="hidden" name="location_id" id="location_id" value="1">
@endif
@include('components.datetimepicker2', array(
'id' => 'purchase_date',
'initialValue' => $stockEntry->purchased_date,
'label' => 'Purchased date',
'format' => 'YYYY-MM-DD',
'initWithNow' => false,
@@ -83,7 +95,7 @@
<div class="checkbox">
<label for="open">
<input type="checkbox" id="open" name="open"> {{ $__t('Opened') }}
<input @if($stockEntry->open == 1) checked @endif type="checkbox" id="open" name="open"> {{ $__t('Opened') }}
</label>
</div>

View File

@@ -42,7 +42,7 @@
</thead>
<tbody class="d-none">
@foreach($stockLog as $stockLogEntry)
<tr class="@if($stockLogEntry->undone == 1) text-muted @endif">
<tr id="stock-booking-{{ $stockLogEntry->id }}-row" class="@if($stockLogEntry->undone == 1) text-muted @endif stock-booking-correlation-{{ $stockLogEntry->correlation_id }}" data-correlation-id="{{ $stockLogEntry->correlation_id }}">
<td class="fit-content border-right">
<a class="btn btn-secondary btn-sm undo-stock-booking-button @if($stockLogEntry->undone == 1) disabled @endif" href="#" data-booking-id="{{ $stockLogEntry->id }}" data-toggle="tooltip" data-placement="left" title="{{ $__t('Undo booking') }}">
<i class="fas fa-undo"></i>