NOW MANAGED ON CODEBERG
Merge branch 'feature/sort-shelf-books' of git://github.com/guillaumehanotel/BookStack into guillaumehanotel-feature/sort-shelf-books
Dan Brownab4c5a55b830
diff --cc app/Http/Controllers/BookshelfController.phpindex 8574c1b48,6c090a26d..14bc9d94e--- a/app/Http/Controllers/BookshelfController.php+++ b/app/Http/Controllers/BookshelfController.php@@@ -101,9 -101,18 +101,18 @@@ class BookshelfController extends Contr$shelf = $this->bookshelfRepo->getBySlug($slug);$this->checkOwnablePermission('book-view', $shelf);+ $sort = setting()->getForCurrentUser('shelf_books_sort', 'name');+ $order = setting()->getForCurrentUser('shelf_books_sort_order', 'asc');++ $visibleShelfBooks = $shelf->visibleBooks()->get();+ $sortedVisibleShelfBooks = $visibleShelfBooks+ ->sortBy($sort, SORT_REGULAR, $order === 'desc')+ ->values()+ ->all();+Views::add($shelf);$this->entityContextManager->setShelfContext($shelf->id);- $view = setting()->getForCurrentUser('bookshelf_view_type', config('app.views.books'));+ $view = setting()->getForCurrentUser('bookshelf_view_type');$this->setPageTitle($shelf->getShortName());return view('shelves.show', [