Default order desc

This commit is contained in:
Sergio Brighenti 2019-01-22 23:54:17 +01:00
parent 61f3d6e742
commit f49d6ef979
2 changed files with 3 additions and 3 deletions

View file

@ -51,7 +51,7 @@ class DashboardController extends Controller
break;
}
$query->orderBy($order, $request->getParam('order', 'ASC'))
$query->orderBy($order, $request->getParam('order', 'DESC'))
->withUserId($this->session->get('user_id'))
->search($request->getParam('search', null))
->run($page);

View file

@ -24,8 +24,8 @@
<a class="dropdown-item" href="{{ queryParams({'sort':'size'}) }}"><i class="fas fa-weight-hanging fa-fw"></i> {{ lang('size') }}</a>
</div>
</div>
<a href="{{ queryParams({'order': request.param('order') is same as('DESC') ? 'ASC' : 'DESC' }) }}" class="btn btn-outline-info">
<i class="fas {{ request.param('order') is same as('DESC') ? 'fa-sort-amount-down' : 'fa-sort-amount-up' }}"></i>
<a href="{{ queryParams({'order': request.param('order') is same as('ASC') ? 'DESC' : 'ASC' }) }}" class="btn btn-outline-info">
<i class="fas {{ request.param('order') is same as('ASC') ? 'fa-sort-amount-up' : 'fa-sort-amount-down' }}"></i>
</a>
</div>
</div>