From ccfc562eadd2940966f272a74310866243422286 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 30 Apr 2021 11:53:02 +0200 Subject: [PATCH] add locale in navigation index; add default navigation order --- core/Controller/Site/NavigationAdminController.php | 4 +++- core/Controller/Site/TreeAdminController.php | 4 +++- core/Resources/views/site/navigation_admin/index.html.twig | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/Controller/Site/NavigationAdminController.php b/core/Controller/Site/NavigationAdminController.php index d048e5e..59b4270 100644 --- a/core/Controller/Site/NavigationAdminController.php +++ b/core/Controller/Site/NavigationAdminController.php @@ -22,7 +22,9 @@ class NavigationAdminController extends AdminController */ public function index(int $page = 1, RepositoryQuery $query, Request $request): Response { - $pager = $query->paginate($page); + $pager = $query + ->orderBy('.label, .domain') + ->paginate($page); return $this->render('@Core/site/navigation_admin/index.html.twig', [ 'pager' => $pager, diff --git a/core/Controller/Site/TreeAdminController.php b/core/Controller/Site/TreeAdminController.php index d3ec3be..ef8165b 100644 --- a/core/Controller/Site/TreeAdminController.php +++ b/core/Controller/Site/TreeAdminController.php @@ -55,7 +55,9 @@ class TreeAdminController extends AdminController MenuFactory $menuFactory, Session $session ): Response { - $navigations = $navigationQuery->create()->find(); + $navigations = $navigationQuery->create() + ->orderBy('.label, .domain') + ->find(); $session->set('site_tree_last_navigation', $navigation->getId()); diff --git a/core/Resources/views/site/navigation_admin/index.html.twig b/core/Resources/views/site/navigation_admin/index.html.twig index 282abfa..d847c60 100644 --- a/core/Resources/views/site/navigation_admin/index.html.twig +++ b/core/Resources/views/site/navigation_admin/index.html.twig @@ -53,6 +53,7 @@ {{ item.domain }} + ({{ item.locale }})