Added book selector to books sort

Now more efficient rather than listing all books in the system.
This commit is contained in:
Dan Brown
2019-04-06 16:56:50 +01:00
parent 17969c0bbf
commit aedff7dc6d
5 changed files with 55 additions and 34 deletions

View File

@ -161,15 +161,17 @@ class BookController extends Controller
* Shows the view which allows pages to be re-ordered and sorted.
* @param string $bookSlug
* @return \Illuminate\View\View
* @throws \BookStack\Exceptions\NotFoundException
*/
public function sort($bookSlug)
{
$book = $this->entityRepo->getBySlug('book', $bookSlug);
$this->checkOwnablePermission('book-update', $book);
$bookChildren = $this->entityRepo->getBookChildren($book, true);
$books = $this->entityRepo->getAll('book', false, 'update');
$this->setPageTitle(trans('entities.books_sort_named', ['bookName'=>$book->getShortName()]));
return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]);
return view('books/sort', ['book' => $book, 'current' => $book, 'bookChildren' => $bookChildren]);
}
/**