namespace BookStack\Http\Controllers;
-use Activity;
+use BookStack\Actions\ActivityQueries;
use BookStack\Entities\Models\Book;
use BookStack\Entities\Models\Page;
use BookStack\Entities\Queries\RecentlyViewed;
/**
* Display the homepage.
*/
- public function index()
+ public function index(ActivityQueries $activities)
{
- $activity = Activity::latest(10);
+ $activity = $activities->latest(10);
$draftPages = [];
if ($this->isSignedIn()) {
$recentlyUpdatedPages = Page::visible()->with('book')
->where('draft', false)
->orderBy('updated_at', 'desc')
- ->take($favourites->count() > 0 ? 6 : 12)
+ ->take($favourites->count() > 0 ? 5 : 10)
->select(Page::$listAttributes)
->get();
if ($homepageOption === 'page') {
$homepageSetting = setting('app-homepage', '0:');
$id = intval(explode(':', $homepageSetting)[0]);
+ /** @var Page $customHomepage */
$customHomepage = Page::query()->where('draft', '=', false)->findOrFail($id);
$pageContent = new PageContent($customHomepage);
- $customHomepage->html = $pageContent->render(true);
+ $customHomepage->html = $pageContent->render(false);
return view('home.specific-page', array_merge($commonData, ['customHomepage' => $customHomepage]));
}
return view('home.default', $commonData);
}
- /**
- * Get custom head HTML, Used in ajax calls to show in editor.
- */
- public function customHeadContent()
- {
- return view('common.custom-head');
- }
-
/**
* Show the view for /robots.txt.
*/