Skip to content

Commit

Permalink
Default order desc
Browse files Browse the repository at this point in the history
  • Loading branch information
sergix44 committed Jan 22, 2019
1 parent 61f3d6e commit f49d6ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function home(Request $request, Response $response, $args): Response
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);
Expand Down
4 changes: 2 additions & 2 deletions resources/templates/dashboard/pager_header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit f49d6ef

Please sign in to comment.