]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/BookshelfController.php
Allow toggling between grid and list view in shelf view (shelves.show)
[bookstack] / app / Http / Controllers / BookshelfController.php
index 57e67dc00e618b53fec9b16eec134242422dd8af..5c9da762fb3499341c4be851bacc455cd13dad2c 100644 (file)
@@ -103,6 +103,7 @@ class BookshelfController extends Controller
     public function show(string $slug)
     {
         $shelf = $this->bookshelfRepo->getBySlug($slug);
+        $view = setting()->getForCurrentUser('books_view_type', config('app.views.books'));
         $this->checkOwnablePermission('book-view', $shelf);
 
         Views::add($shelf);
@@ -111,6 +112,7 @@ class BookshelfController extends Controller
         $this->setPageTitle($shelf->getShortName());
         return view('shelves.show', [
             'shelf' => $shelf,
+            'view' => $view,
             'activity' => Activity::entityActivity($shelf, 20, 1)
         ]);
     }