Pagination on status page, previous and next week

This commit is contained in:
Joseph Cohen
2015-01-03 00:36:27 -06:00
parent da8f4e7b0f
commit 44bb043a2b
3 changed files with 44 additions and 5 deletions
+2
View File
@@ -35,6 +35,8 @@ return [
'setup' => 'Setup Cachet',
'no_incidents' => 'No incidents reported.',
'past_incidents' => 'Past incidents',
'previous_week' => 'Previous week',
'next_week' => 'Next week',
// Dashboard
'dashboard' => [
'dashboard' => 'Dashboard',
+16
View File
@@ -29,4 +29,20 @@
@foreach($allIncidents as $incidents)
@include('partials.incidents', $incidents)
@endforeach
<hr/>
<nav>
<ul class="pager">
<li class="previous">
<a href="{{ route('status-page') }}?start_date={{ $previousDate }}">
<span aria-hidden="true">&larr;</span> {{ trans('cachet.previous_week') }}
</a>
</li>
<li class="next @if( ! $canPageForward) disabled @endif">
<a @if($canPageForward) href="{{ route('status-page') }}?start_date={{ $nextDate }}" @endif>
{{ trans('cachet.next_week') }} <span aria-hidden="true">&rarr;</span>
</a>
</li>
</ul>
</nav>
@stop