Make info bars clickable and add a filter for them on all overview pages (references #60)

This commit is contained in:
Bernd Bestel
2018-09-24 19:13:53 +02:00
parent 067a10e1b2
commit 7401971884
12 changed files with 188 additions and 17 deletions

View File

@@ -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>