mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Make info bars clickable and add a filter for them on all overview pages (references #60)
This commit is contained in:
parent
067a10e1b2
commit
7401971884
@ -243,6 +243,12 @@ return array(
|
||||
'Are you sure to delete product group "#1"?' => 'Produktgruppe "#1" wirklich löschen?',
|
||||
'Stay logged in permanently' => 'Dauerhaft angemeldet bleiben',
|
||||
'When not set, you will get logged out at latest after 30 days' => 'Wenn nicht gesetzt, wirst du spätestens nach 30 Tagen automatisch abgemeldet',
|
||||
'Filter by status' => 'Nach Status filtern',
|
||||
'Below min. stock amount' => 'Unter Mindestbestand',
|
||||
'Expiring soon' => 'Bald ablaufend',
|
||||
'Already expired' => 'Bereits abgelaufen',
|
||||
'Due soon' => 'Bald fällig',
|
||||
'Overdue' => 'Überfällig',
|
||||
|
||||
//Constants
|
||||
'manually' => 'Manuell',
|
||||
|
@ -11,10 +11,6 @@ body {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.no-real-button {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.timeago-contextual {
|
||||
font-style: italic;
|
||||
font-size: 0.8em;
|
||||
|
@ -25,6 +25,27 @@ $("#search").on("keyup", function()
|
||||
batteriesOverviewTable.search(value).draw();
|
||||
});
|
||||
|
||||
$("#status-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
// Transfer CSS classes of selected element to dropdown element (for background)
|
||||
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
|
||||
|
||||
batteriesOverviewTable.column(4).search(value).draw();
|
||||
});
|
||||
|
||||
$(".status-filter-button").on("click", function()
|
||||
{
|
||||
var value = $(this).data("status-filter");
|
||||
$("#status-filter").val(value);
|
||||
$("#status-filter").trigger("change");
|
||||
});
|
||||
|
||||
$(document).on('click', '.track-charge-cycle-button', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
@ -25,6 +25,27 @@ $("#search").on("keyup", function()
|
||||
choresOverviewTable.search(value).draw();
|
||||
});
|
||||
|
||||
$("#status-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
// Transfer CSS classes of selected element to dropdown element (for background)
|
||||
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
|
||||
|
||||
choresOverviewTable.column(4).search(value).draw();
|
||||
});
|
||||
|
||||
$(".status-filter-button").on("click", function()
|
||||
{
|
||||
var value = $(this).data("status-filter");
|
||||
$("#status-filter").val(value);
|
||||
$("#status-filter").trigger("change");
|
||||
});
|
||||
|
||||
$(document).on('click', '.track-chore-button', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
@ -30,6 +30,27 @@ $("#search").on("keyup", function()
|
||||
shoppingListTable.search(value).draw();
|
||||
});
|
||||
|
||||
$("#status-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
// Transfer CSS classes of selected element to dropdown element (for background)
|
||||
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
|
||||
|
||||
shoppingListTable.column(4).search(value).draw();
|
||||
});
|
||||
|
||||
$(".status-filter-button").on("click", function()
|
||||
{
|
||||
var value = $(this).data("status-filter");
|
||||
$("#status-filter").val(value);
|
||||
$("#status-filter").trigger("change");
|
||||
});
|
||||
|
||||
$(document).on('click', '.shoppinglist-delete-button', function (e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
@ -26,6 +26,27 @@ $("#location-filter").on("change", function()
|
||||
stockOverviewTable.column(4).search(value).draw();
|
||||
});
|
||||
|
||||
$("#status-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
// Transfer CSS classes of selected element to dropdown element (for background)
|
||||
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
|
||||
|
||||
stockOverviewTable.column(5).search(value).draw();
|
||||
});
|
||||
|
||||
$(".status-filter-button").on("click", function()
|
||||
{
|
||||
var value = $(this).data("status-filter");
|
||||
$("#status-filter").val(value);
|
||||
$("#status-filter").trigger("change");
|
||||
});
|
||||
|
||||
$("#search").on("keyup", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
|
@ -29,6 +29,27 @@ $("#search").on("keyup", function()
|
||||
tasksTable.search(value).draw();
|
||||
});
|
||||
|
||||
$("#status-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
// Transfer CSS classes of selected element to dropdown element (for background)
|
||||
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
|
||||
|
||||
tasksTable.column(5).search(value).draw();
|
||||
});
|
||||
|
||||
$(".status-filter-button").on("click", function()
|
||||
{
|
||||
var value = $(this).data("status-filter");
|
||||
$("#status-filter").val(value);
|
||||
$("#status-filter").trigger("change");
|
||||
});
|
||||
|
||||
$(document).on('click', '.do-task-button', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
@ -12,12 +12,20 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1>@yield('title')</h1>
|
||||
<p id="info-due-batteries" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning no-real-button responsive-button mr-2"></p>
|
||||
<p id="info-overdue-batteries" class="btn btn-lg btn-danger no-real-button responsive-button"></p>
|
||||
<p id="info-due-batteries" data-status-filter="duesoon" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning status-filter-button responsive-button mr-2"></p>
|
||||
<p id="info-overdue-batteries" data-status-filter="overdue" class="btn btn-lg btn-danger status-filter-button responsive-button"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<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="duesoon">{{ $L('Due soon') }}</option>
|
||||
<option class="bg-danger" value="overdue">{{ $L('Overdue') }}</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">
|
||||
@ -33,6 +41,7 @@
|
||||
<th>{{ $L('Battery') }}</th>
|
||||
<th>{{ $L('Last charged') }}</th>
|
||||
<th>{{ $L('Next planned charge cycle') }}</th>
|
||||
<th class="d-none">Hidden status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -60,6 +69,9 @@
|
||||
...
|
||||
@endif
|
||||
</td>
|
||||
<td class="d-none">
|
||||
"@if(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0 && $curentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s')) overdue @elseif(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0 && $curentBatteryEntry->next_estimated_charge_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) duesoon @endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@ -12,12 +12,20 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1>@yield('title')</h1>
|
||||
<p id="info-due-chores" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning no-real-button responsive-button mr-2"></p>
|
||||
<p id="info-overdue-chores" class="btn btn-lg btn-danger no-real-button responsive-button"></p>
|
||||
<p id="info-due-chores" data-status-filter="duesoon" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning status-filter-button responsive-button mr-2"></p>
|
||||
<p id="info-overdue-chores" data-status-filter="overdue" class="btn btn-lg btn-danger status-filter-button responsive-button"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<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="duesoon">{{ $L('Due soon') }}</option>
|
||||
<option class="bg-danger" value="overdue">{{ $L('Overdue') }}</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">
|
||||
@ -33,6 +41,7 @@
|
||||
<th>{{ $L('Chore') }}</th>
|
||||
<th>{{ $L('Next estimated tracking') }}</th>
|
||||
<th>{{ $L('Last tracked') }}</th>
|
||||
<th class="d-none">Hidden status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -63,6 +72,9 @@
|
||||
<span id="chore-{{ $curentChoreEntry->chore_id }}-last-tracked-time">{{ $curentChoreEntry->last_tracked_time }}</span>
|
||||
<time id="chore-{{ $curentChoreEntry->chore_id }}-last-tracked-time-timeago" class="timeago timeago-contextual" datetime="{{ $curentChoreEntry->last_tracked_time }}"></time>
|
||||
</td>
|
||||
<td class="d-none">
|
||||
@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type === \Grocy\Services\ChoresService::CHORE_TYPE_DYNAMIC_REGULAR && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s')) overdue @elseif(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type === \Grocy\Services\ChoresService::CHORE_TYPE_DYNAMIC_REGULAR && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) duesoon @endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@ -29,15 +29,26 @@
|
||||
<i class="fas fa-cart-plus"></i> {{ $L('Add products that are below defined min. stock amount') }}
|
||||
</a>
|
||||
</h1>
|
||||
<p class="btn btn-lg btn-info no-real-button responsive-button">{{ Pluralize(count($missingProducts), $L('#1 product is below defined min. stock amount', count($missingProducts)), $L('#1 products are below defined min. stock amount', count($missingProducts))) }}</p>
|
||||
<p data-status-filter="belowminstockamount" class="btn btn-lg btn-info status-filter-button responsive-button">{{ Pluralize(count($missingProducts), $L('#1 product is below defined min. stock amount', count($missingProducts)), $L('#1 products are below defined min. stock amount', count($missingProducts))) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<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-info" value="belowminstockamount">{{ $L('Below min. stock amount') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<label for="search">{{ $L('Search') }}</label> <i class="fas fa-search"></i>
|
||||
<input type="text" class="form-control" id="search">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-8 pb-3">
|
||||
<label for="search">{{ $L('Search') }}</label> <i class="fas fa-search"></i>
|
||||
<input type="text" class="form-control" id="search">
|
||||
|
||||
<table id="shoppinglist-table" class="table table-sm table-striped dt-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -45,6 +56,7 @@
|
||||
<th>{{ $L('Product') }} / <em>{{ $L('Note') }}</em></th>
|
||||
<th>{{ $L('Amount') }}</th>
|
||||
<th class="d-none">Hiden product group</th>
|
||||
<th class="d-none">Hidden status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -67,6 +79,9 @@
|
||||
<td class="d-none">
|
||||
@if(!empty(FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->product_group_id)) {{ FindObjectInArrayByPropertyValue($productGroups, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->product_group_id)->name }} @else <span class="font-italic font-weight-light">{{ $L('Ungrouped') }}</span> @endif
|
||||
</td>
|
||||
<td class="d-none">
|
||||
@if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) belowminstockamount @endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@ -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>
|
||||
|
@ -23,12 +23,20 @@
|
||||
<i class="fas fa-plus"></i> {{ $L('Add') }}
|
||||
</a>
|
||||
</h1>
|
||||
<p id="info-due-tasks" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning no-real-button responsive-button mr-2"></p>
|
||||
<p id="info-overdue-tasks" class="btn btn-lg btn-danger no-real-button responsive-button"></p>
|
||||
<p id="info-due-tasks" data-status-filter="duesoon" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning status-filter-button responsive-button mr-2"></p>
|
||||
<p id="info-overdue-tasks" data-status-filter="overdue" class="btn btn-lg btn-danger status-filter-button responsive-button"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<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="duesoon">{{ $L('Due soon') }}</option>
|
||||
<option class="bg-danger" value="overdue">{{ $L('Overdue') }}</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">
|
||||
@ -53,6 +61,7 @@
|
||||
<th>{{ $L('Due') }}</th>
|
||||
<th class="d-none">Hidden category</th>
|
||||
<th>{{ $L('Assigned to') }}</th>
|
||||
<th class="d-none">Hidden status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -86,6 +95,9 @@
|
||||
<td>
|
||||
@if($task->assigned_to_user_id != null) <span>{{ GetUserDisplayName(FindObjectInArrayByPropertyValue($users, 'id', $task->assigned_to_user_id)) }}</span> @endif
|
||||
</td>
|
||||
<td class="d-none">
|
||||
@if($task->done == 1) text-muted @endif @if(!empty($task->due_date) && $task->due_date < date('Y-m-d')) overdue @elseif(!empty($task->due_date) && $task->due_date < date('Y-m-d', strtotime("+$nextXDays days"))) duesoon @endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
Loading…
x
Reference in New Issue
Block a user