0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-17 13:52:04 +00:00

Allow toggling between grid and list view in shelf view (shelves.show)

This commit is contained in:
jakob 2019-10-30 11:23:42 +01:00
parent 189a598d56
commit 6cd26e23a8
2 changed files with 17 additions and 5 deletions
app/Http/Controllers

View 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)
]);
}