mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Fixed short editor in firefox and optimised some queries
Optimised permission fetching so that it won't initialise a bunch of models for the role permissions and instead does a manual query to get the data directly.
This commit is contained in:
@ -25,6 +25,7 @@ class HomeController extends Controller
|
||||
->where('draft', '=', true)
|
||||
->where('created_by', '=', user()->id)
|
||||
->orderBy('updated_at', 'desc')
|
||||
->with('book')
|
||||
->take(6)
|
||||
->get();
|
||||
}
|
||||
@ -33,8 +34,11 @@ class HomeController extends Controller
|
||||
$recents = $this->isSignedIn() ?
|
||||
Views::getUserRecentlyViewed(12*$recentFactor, 1)
|
||||
: Book::visible()->orderBy('created_at', 'desc')->take(12 * $recentFactor)->get();
|
||||
$recentlyUpdatedPages = Page::visible()->where('draft', false)
|
||||
->orderBy('updated_at', 'desc')->take(12)->get();
|
||||
$recentlyUpdatedPages = Page::visible()->with('book')
|
||||
->where('draft', false)
|
||||
->orderBy('updated_at', 'desc')
|
||||
->take(12)
|
||||
->get();
|
||||
|
||||
$homepageOptions = ['default', 'books', 'bookshelves', 'page'];
|
||||
$homepageOption = setting('app-homepage-type', 'default');
|
||||
|
Reference in New Issue
Block a user