add different table sort options, change default to last-updated

This commit is contained in:
2018-08-16 22:19:03 +02:00
parent 83392e07ac
commit a9426759d2
3 changed files with 69 additions and 10 deletions
+24 -2
View File
@@ -1,5 +1,10 @@
{{-- Public landing page --}}
@php
/** @var \App\Models\User[]|\Illuminate\Support\Collection|\Illuminate\Pagination\LengthAwarePaginator $users */
/** @var \App\Models\Table[]|\Illuminate\Support\Collection|\Illuminate\Pagination\LengthAwarePaginator $tables */
@endphp
@extends('layouts.app')
@section('content')
@@ -44,10 +49,27 @@
<div class="card">
<div class="card-header card-header-extra">
@icon(fa-table fa-pr fa-large)
<h2>Popular Tables</h2>
<h2>Tables:</h2>
<span>
<a class="nav-link dropdown-toggle link-no-color pl-1 ml-1 pr-2"
data-toggle="dropdown" href="#" role="button" aria-haspopup="true"
aria-expanded="false">{{ $sortOptions[$tableSort] }}</a>
<div class="dropdown-menu">
@foreach($sortOptions as $k => $label)
{{--@if($k != $tableSort)--}}
<a class="dropdown-item"
href="{{ route('dash', Input::except(['tableSort', 'tablePage']) + ['tableSort' => $k]) }}">
{{ $label }}
</a>
{{--@endif--}}
@endforeach
</div>
</span>
<nav class="ml-auto" aria-label="Pages of the table list">
{{ $tables->links(null, ['ulClass' => 'pagination-sm mb-0 pagination-outline-light']) }}
{{ $tables->links(null, [
'ulClass' => 'pagination-sm mb-0 pagination-outline-light'
]) }}
</nav>
@if(authed() && user()->confirmed)