$recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('book', 4, 0) : false;
$popular = $this->entityRepo->getPopular('book', 4, 0);
$new = $this->entityRepo->getRecentlyCreated('book', 4, 0);
- $this->setPageTitle('Books');
+ $booksViewType = setting()->getUser($this->currentUser, 'books_view_type', 'list');
+ $this->setPageTitle(trans('entities.books'));
return view('books/index', [
'books' => $books,
'recents' => $recents,
'popular' => $popular,
- 'new' => $new
+ 'new' => $new,
+ 'booksViewType' => $booksViewType
]);
}
$this->checkOwnablePermission('book-update', $book);
// Return if no map sent
- if (!$request->has('sort-tree')) {
+ if (!$request->filled('sort-tree')) {
return redirect($book->getUrl());
}