mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Make info bars clickable and add a filter for them on all overview pages (references #60)
This commit is contained in:
@@ -12,9 +12,9 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1>@yield('title') <small id="info-current-stock" class="text-muted"></small></h1>
|
||||
<p id="info-expiring-products" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning no-real-button responsive-button mr-2"></p>
|
||||
<p id="info-expired-products" class="btn btn-lg btn-danger no-real-button responsive-button mr-2"></p>
|
||||
<p id="info-missing-products" class="btn btn-lg btn-info no-real-button responsive-button"></p>
|
||||
<p id="info-expiring-products" data-next-x-days="{{ $nextXDays }}" data-status-filter="expiring" class="btn btn-lg btn-warning status-filter-button responsive-button mr-2"></p>
|
||||
<p id="info-expired-products" data-status-filter="expired" class="btn btn-lg btn-danger status-filter-button responsive-button mr-2"></p>
|
||||
<p id="info-missing-products" data-status-filter="belowminstockamount" class="btn btn-lg btn-info status-filter-button responsive-button"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,6 +28,15 @@
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<label for="status-filter">{{ $L('Filter by status') }}</label> <i class="fas fa-filter"></i>
|
||||
<select class="form-control" id="status-filter">
|
||||
<option class="bg-white" value="all">{{ $L('All') }}</option>
|
||||
<option class="bg-warning" value="expiring">{{ $L('Expiring soon') }}</option>
|
||||
<option class="bg-danger" value="expired">{{ $L('Already expired') }}</option>
|
||||
<option class="bg-info" value="belowminstockamount">{{ $L('Below min. stock amount') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<label for="search">{{ $L('Search') }}</label> <i class="fas fa-search"></i>
|
||||
<input type="text" class="form-control" id="search">
|
||||
@@ -44,6 +53,7 @@
|
||||
<th>{{ $L('Amount') }}</th>
|
||||
<th>{{ $L('Next best before date') }}</th>
|
||||
<th class="d-none">Hidden location</th>
|
||||
<th class="d-none">Hidden status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -78,6 +88,9 @@
|
||||
<td class="d-none">
|
||||
{{ FindObjectInArrayByPropertyValue($locations, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->location_id)->name }}
|
||||
</td>
|
||||
<td class="d-none">
|
||||
@if($currentStockEntry->best_before_date < date('Y-m-d', strtotime('-1 days'))) expired @elseif($currentStockEntry->best_before_date < date('Y-m-d', strtotime("+$nextXDays days"))) expiring @elseif (FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) belowminstockamount @endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
Reference in New Issue
Block a user