mirror of
https://github.com/grocy/grocy.git
synced 2026-04-03 11:26:16 +02:00
Fix Location Content Sheet filter checkbox
Previously, the query parameter functioned as expected, but the checkbox always appeared checked. Additionally, clicking the checkbox would always result in the "unchecked" state despite remaining visually checked. This adds the required context to the controller and an @if directive to the checkbox's checked attribute in the view to match.
This commit is contained in:
parent
ebcc9a422e
commit
40ed85f096
|
|
@ -93,7 +93,8 @@ class StockController extends BaseController
|
|||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'currentStockLocationContent' => $this->getStockService()->GetCurrentStockLocationContent(isset($request->getQueryParams()['include_out_of_stock']))
|
||||
'currentStockLocationContent' => $this->getStockService()->GetCurrentStockLocationContent(isset($request->getQueryParams()['include_out_of_stock'])),
|
||||
'includeOutOfStockProductsAtTheDefaultLocation' => isset($request->getQueryParams()['include_out_of_stock'])
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
<input class="form-check-input custom-control-input"
|
||||
type="checkbox"
|
||||
id="include-out-of-stock"
|
||||
checked>
|
||||
@if(!$includeOutOfStockProductsAtTheDefaultLocation) checked @endif>
|
||||
<label class="form-check-label custom-control-label"
|
||||
for="include-out-of-stock">
|
||||
{{ $__t('Show only in stock products') }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user