chg: [dashboard redirects] to individual models now sort by modified by default

- the dashboard shows new entries, it only makes sense to sort the list based on changes

- also a small fix to not sanitise the index URLs as this will lead to multiple query parameters not working
pull/170/merge
iglocska 2024-05-22 16:10:14 +02:00
parent 75f55f5368
commit 1e7a1a5f3e
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,7 @@
<?php
use Cake\ORM\TableRegistry;
use Cake\Routing\Router;
$bookmarks = !empty($loggedUser->user_settings_by_name['ui.bookmarks']['value']) ? json_decode($loggedUser->user_settings_by_name['ui.bookmarks']['value'], true) : [];
$this->userSettingsTable = TableRegistry::getTableLocator()->get('UserSettings');
@ -49,9 +50,10 @@ $this->userSettingsTable = TableRegistry::getTableLocator()->get('UserSettings')
$modelForDisplay = $exploded[count($exploded) - 1];
$panelTitle = $this->Html->link(
h($modelForDisplay),
$this->Url->build([
Router::url([
'controller' => $modelForDisplay,
'action' => 'index',
'?' => ['sort' => 'modified', 'direction' => 'desc']
]),
['class' => 'text-white text-decoration-none fw-light stretched-link']
);