diff --git a/app/Http/Controllers/Shop/CategoryController.php b/app/Http/Controllers/Shop/CategoryController.php
index f7539f00..7d79318d 100644
--- a/app/Http/Controllers/Shop/CategoryController.php
+++ b/app/Http/Controllers/Shop/CategoryController.php
@@ -18,9 +18,10 @@ class CategoryController extends Controller
return $dataTable->render('Shop.Categories.list');
}
- public function show($category_id)
+ public function show(Request $request, $category_id)
{
$data = self::init();
+ $data['display_by_rows'] = $request->input('by_rows') ?? false;
$data['category'] = Categories::getFull($category_id);
$data['articles'] = Articles::getArticlesToSell($category_id);
$data['tags'] = TagGroups::getWithTagsAndCountOffers();
diff --git a/resources/views/Shop/layout/layout.blade.php b/resources/views/Shop/layout/layout.blade.php
index ebc5f0c1..258387a5 100644
--- a/resources/views/Shop/layout/layout.blade.php
+++ b/resources/views/Shop/layout/layout.blade.php
@@ -25,9 +25,7 @@
-
@include("Shop.layout.partials.header")
-
-
@include("Shop.layout.partials.footer")
-
-
-
+
@stack('scripts')
-
+
diff --git a/resources/views/Shop/layout/partials/category_add.blade.php b/resources/views/Shop/layout/partials/category_add.blade.php
index e202346b..f0537527 100644
--- a/resources/views/Shop/layout/partials/category_add.blade.php
+++ b/resources/views/Shop/layout/partials/category_add.blade.php
@@ -15,9 +15,31 @@
Il y a {{ count($articles) ?? 0 }} article(s) dans la liste
+
+
+
+
+
+ @include('components.form.button', ['id' => 'by_cards', 'icon' => 'fa-th', 'class' => 'btn-success'])
+ @include('components.form.button', ['id' => 'by_rows', 'icon' => 'fa-list', 'class' => 'btn-success'])
+
+
-
\ No newline at end of file
+
+
+@push('js')
+
+@endpush
\ No newline at end of file
diff --git a/resources/views/Shop/layout/partials/header-nav.blade.php b/resources/views/Shop/layout/partials/header-nav.blade.php
index a6a48ba8..da348898 100644
--- a/resources/views/Shop/layout/partials/header-nav.blade.php
+++ b/resources/views/Shop/layout/partials/header-nav.blade.php
@@ -1,7 +1,7 @@
diff --git a/resources/views/Shop/shelve.blade.php b/resources/views/Shop/shelve.blade.php
index d7ce3a9e..e8f5abf4 100644
--- a/resources/views/Shop/shelve.blade.php
+++ b/resources/views/Shop/shelve.blade.php
@@ -17,7 +17,11 @@
@include('Shop.layout.partials.category_add')
- @include('Shop.layout.partials.category_articles')
+ @if ($display_by_rows ?? false)
+ @include('Shop.layout.partials.category_articles_rows')
+ @else
+ @include('Shop.layout.partials.category_articles')
+ @endif
@endsection
\ No newline at end of file