1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Sort Books within Shelves

This commit is contained in:
Guillaume Hanotel
2021-01-29 07:58:17 +01:00
parent 7ba6962707
commit 26ba056302
3 changed files with 36 additions and 5 deletions

View File

@ -101,6 +101,9 @@ class BookshelfController extends Controller
$shelf = $this->bookshelfRepo->getBySlug($slug);
$this->checkOwnablePermission('book-view', $shelf);
$sort = setting()->getForCurrentUser('books_sort', 'name');
$order = setting()->getForCurrentUser('books_sort_order', 'asc');
Views::add($shelf);
$this->entityContextManager->setShelfContext($shelf->id);
$view = setting()->getForCurrentUser('bookshelf_view_type', config('app.views.books'));
@ -109,7 +112,9 @@ class BookshelfController extends Controller
return view('shelves.show', [
'shelf' => $shelf,
'view' => $view,
'activity' => Activity::entityActivity($shelf, 20, 1)
'activity' => Activity::entityActivity($shelf, 20, 1),
'order' => $order,
'sort' => $sort
]);
}