From 745c9501fee167c2ece857374eae2af43e1bf24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 7 Feb 2023 16:49:05 +0100 Subject: [PATCH] indexes fix --- resources/views/pages/delivery-modes/indexList.blade.php | 2 +- resources/views/pages/discounts/indexList.blade.php | 2 +- resources/views/pages/general-configs/indexList.blade.php | 2 +- resources/views/pages/orders/indexList.blade.php | 2 +- resources/views/pages/products/indexList.blade.php | 4 ++++ resources/views/pages/ranges/indexList.blade.php | 4 ++++ resources/views/pages/shops/indexList.blade.php | 8 ++++---- resources/views/pages/static_pages/indexList.blade.php | 2 +- resources/views/pages/tags/indexList.blade.php | 2 +- 9 files changed, 18 insertions(+), 10 deletions(-) diff --git a/resources/views/pages/delivery-modes/indexList.blade.php b/resources/views/pages/delivery-modes/indexList.blade.php index 9c9b0d6..b74651e 100644 --- a/resources/views/pages/delivery-modes/indexList.blade.php +++ b/resources/views/pages/delivery-modes/indexList.blade.php @@ -6,8 +6,8 @@ 'name' => __('Mode'), 'status' => __('Disponible sur le site ?'), 'is_free' => __('Frais de livraison offerts ?')]; - $rst = !is_null(request()->rst); $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp diff --git a/resources/views/pages/discounts/indexList.blade.php b/resources/views/pages/discounts/indexList.blade.php index 7f1d2a6..844121a 100644 --- a/resources/views/pages/discounts/indexList.blade.php +++ b/resources/views/pages/discounts/indexList.blade.php @@ -10,8 +10,8 @@ 'status' => __('Pris en compte'), 'products' => __('models.classes.products'), 'updated_at' => __('Mis à jour le')]; - $rst = !is_null(request()->rst); $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp diff --git a/resources/views/pages/general-configs/indexList.blade.php b/resources/views/pages/general-configs/indexList.blade.php index 1c26e7a..793a746 100644 --- a/resources/views/pages/general-configs/indexList.blade.php +++ b/resources/views/pages/general-configs/indexList.blade.php @@ -4,8 +4,8 @@ @php $cols = [ 'name' => __('Mode')]; - $rst = !is_null(request()->rst); $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp diff --git a/resources/views/pages/orders/indexList.blade.php b/resources/views/pages/orders/indexList.blade.php index d6e3d97..b1d060d 100644 --- a/resources/views/pages/orders/indexList.blade.php +++ b/resources/views/pages/orders/indexList.blade.php @@ -13,8 +13,8 @@ 'timeslot_date' => __('Date de retrait'), 'shop' => __('Point de retrait'), 'updated_at' => __('Mis à jour le')]; - $rst = !is_null(request()->rst); $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp diff --git a/resources/views/pages/products/indexList.blade.php b/resources/views/pages/products/indexList.blade.php index a2efb74..d2c7d91 100644 --- a/resources/views/pages/products/indexList.blade.php +++ b/resources/views/pages/products/indexList.blade.php @@ -17,6 +17,10 @@ 'status' => __('Publication'), 'updated_at' => __('Mis à jour le') ]); + $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); + $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); + $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp @include('back::modules.tableColSorter', [ 'cols' => $cols, diff --git a/resources/views/pages/ranges/indexList.blade.php b/resources/views/pages/ranges/indexList.blade.php index 1668ad4..f9bdb1f 100644 --- a/resources/views/pages/ranges/indexList.blade.php +++ b/resources/views/pages/ranges/indexList.blade.php @@ -7,6 +7,10 @@ 'description' => __('Description'), 'status' => __('Publication'), 'updated_at' => __('Mis à jour le')]; + $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); + $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); + $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp @include('back::modules.tableColSorter', [ 'cols' => $cols, diff --git a/resources/views/pages/shops/indexList.blade.php b/resources/views/pages/shops/indexList.blade.php index 30b87de..c4a9226 100644 --- a/resources/views/pages/shops/indexList.blade.php +++ b/resources/views/pages/shops/indexList.blade.php @@ -7,10 +7,10 @@ 'address' => __('Adresse'), 'phone' => __('Téléphone'), 'updated_at' => __('Mis à jour le')]; - $rst = !is_null(request()->rst); - $routeName = request()->route()->getName(); - $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); - $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); + $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); + $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); + $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp @include('back::modules.tableColSorter', [ 'cols' => $cols, diff --git a/resources/views/pages/static_pages/indexList.blade.php b/resources/views/pages/static_pages/indexList.blade.php index e8503e9..27df4c0 100644 --- a/resources/views/pages/static_pages/indexList.blade.php +++ b/resources/views/pages/static_pages/indexList.blade.php @@ -6,8 +6,8 @@ 'title' => __('titre'), 'value' => __('contenu'), 'updated_at' => __('Mis à jour le')]; - $rst = !is_null(request()->rst); $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp diff --git a/resources/views/pages/tags/indexList.blade.php b/resources/views/pages/tags/indexList.blade.php index 431bac3..d4d9231 100644 --- a/resources/views/pages/tags/indexList.blade.php +++ b/resources/views/pages/tags/indexList.blade.php @@ -6,8 +6,8 @@ 'label' => __('Label'), 'order' => __('Ordre'), 'status' => __('Statut')]; - $rst = !is_null(request()->rst); $routeName = request()->route()->getName(); + $rst = !is_null(request()->rst) || !Session::has("$routeName.sorted"); $noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); $noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")); @endphp