mirror of
https://github.com/grocy/grocy.git
synced 2025-04-30 10:05:45 +00:00
Re-apply filter after chore execution on the chores overview page
This commit is contained in:
parent
182d063886
commit
4dd804003b
@ -114,13 +114,16 @@ $(document).on('click', '.track-chore-button', function(e)
|
|||||||
|
|
||||||
choreRow.removeClass("table-warning");
|
choreRow.removeClass("table-warning");
|
||||||
choreRow.removeClass("table-danger");
|
choreRow.removeClass("table-danger");
|
||||||
|
$('#chore-' + choreId + '-due-filter-column').html("");
|
||||||
if (nextExecutionTime.isBefore(now))
|
if (nextExecutionTime.isBefore(now))
|
||||||
{
|
{
|
||||||
choreRow.addClass("table-danger");
|
choreRow.addClass("table-danger");
|
||||||
|
$('#chore-' + choreId + '-due-filter-column').html("overdue");
|
||||||
}
|
}
|
||||||
else if (nextExecutionTime.isBefore(nextXDaysThreshold))
|
else if (nextExecutionTime.isBefore(nextXDaysThreshold))
|
||||||
{
|
{
|
||||||
choreRow.addClass("table-warning");
|
choreRow.addClass("table-warning");
|
||||||
|
$('#chore-' + choreId + '-due-filter-column').html("duesoon");
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#chore-' + choreId + '-last-tracked-time').parent().effect('highlight', { }, 500);
|
$('#chore-' + choreId + '-last-tracked-time').parent().effect('highlight', { }, 500);
|
||||||
@ -157,6 +160,10 @@ $(document).on('click', '.track-chore-button', function(e)
|
|||||||
setTimeout(function()
|
setTimeout(function()
|
||||||
{
|
{
|
||||||
RefreshContextualTimeago();
|
RefreshContextualTimeago();
|
||||||
|
|
||||||
|
// Refresh the DataTable to re-apply filters
|
||||||
|
choresOverviewTable.rows().invalidate().draw(false);
|
||||||
|
$(".input-group-filter").trigger("change");
|
||||||
}, 550);
|
}, 550);
|
||||||
},
|
},
|
||||||
function(xhr)
|
function(xhr)
|
||||||
|
@ -25,11 +25,11 @@
|
|||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||||
<label for="search">{{ $__t('Search') }}</label> <i class="fas fa-search"></i>
|
<label for="search">{{ $__t('Search') }}</label> <i class="fas fa-search"></i>
|
||||||
<input type="text" class="form-control" id="search">
|
<input type="text" class="form-control input-group-filter" id="search">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||||
<label for="status-filter">{{ $__t('Filter by status') }}</label> <i class="fas fa-filter"></i>
|
<label for="status-filter">{{ $__t('Filter by status') }}</label> <i class="fas fa-filter"></i>
|
||||||
<select class="form-control" id="status-filter">
|
<select class="form-control input-group-filter" id="status-filter">
|
||||||
<option class="bg-white" value="all">{{ $__t('All') }}</option>
|
<option class="bg-white" value="all">{{ $__t('All') }}</option>
|
||||||
<option class="bg-warning" value="duesoon">{{ $__t('Due soon') }}</option>
|
<option class="bg-warning" value="duesoon">{{ $__t('Due soon') }}</option>
|
||||||
<option class="bg-danger" value="overdue">{{ $__t('Overdue') }}</option>
|
<option class="bg-danger" value="overdue">{{ $__t('Overdue') }}</option>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||||
<label for="user-filter">{{ $__t('Filter by assignment') }}</label> <i class="fas fa-filter"></i>
|
<label for="user-filter">{{ $__t('Filter by assignment') }}</label> <i class="fas fa-filter"></i>
|
||||||
<select class="form-control" id="user-filter">
|
<select class="form-control input-group-filter" id="user-filter">
|
||||||
<option></option>
|
<option></option>
|
||||||
@foreach($users as $user)
|
@foreach($users as $user)
|
||||||
<option class="@if($user->id == GROCY_USER_ID) bg-secondary text-white @endif" data-user-id="{{ $user->id }}" value="xx{{ $user->id }}xx">{{ $user->display_name }}</option>
|
<option class="@if($user->id == GROCY_USER_ID) bg-secondary text-white @endif" data-user-id="{{ $user->id }}" value="xx{{ $user->id }}xx">{{ $user->display_name }}</option>
|
||||||
@ -115,9 +115,8 @@
|
|||||||
@endif
|
@endif
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="d-none">
|
<td id="chore-{{ $curentChoreEntry->chore_id }}-due-filter-column" class="d-none">
|
||||||
@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $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_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) duesoon @endif
|
@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $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_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) duesoon @endif
|
||||||
@if($curentChoreEntry->next_execution_assigned_to_user_id == GROCY_USER_ID) assigned-to-me @endif
|
|
||||||
</td>
|
</td>
|
||||||
<td class="d-none">
|
<td class="d-none">
|
||||||
@if(!empty($curentChoreEntry->next_execution_assigned_to_user_id))
|
@if(!empty($curentChoreEntry->next_execution_assigned_to_user_id))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user