mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-07 17:40:57 +00:00
Comments: Updated to show as nested threads
Initial functional implementation, a lot of tweaking and adapting to be done.
This commit is contained in:
parent
88785aa71b
commit
4b9f6beb37
8 changed files with 143 additions and 35 deletions
app/Entities/Controllers
|
@ -3,6 +3,7 @@
|
|||
namespace BookStack\Entities\Controllers;
|
||||
|
||||
use BookStack\Activity\Models\View;
|
||||
use BookStack\Activity\Tools\CommentTree;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use BookStack\Entities\Tools\BookContents;
|
||||
|
@ -140,15 +141,10 @@ class PageController extends Controller
|
|||
|
||||
$pageContent = (new PageContent($page));
|
||||
$page->html = $pageContent->render();
|
||||
$sidebarTree = (new BookContents($page->book))->getTree();
|
||||
$pageNav = $pageContent->getNavigation($page->html);
|
||||
|
||||
// Check if page comments are enabled
|
||||
$commentsEnabled = !setting('app-disable-comments');
|
||||
if ($commentsEnabled) {
|
||||
$page->load(['comments.createdBy']);
|
||||
}
|
||||
|
||||
$sidebarTree = (new BookContents($page->book))->getTree();
|
||||
$commentTree = (new CommentTree($page));
|
||||
$nextPreviousLocator = new NextPreviousContentLocator($page, $sidebarTree);
|
||||
|
||||
View::incrementFor($page);
|
||||
|
@ -159,7 +155,7 @@ class PageController extends Controller
|
|||
'book' => $page->book,
|
||||
'current' => $page,
|
||||
'sidebarTree' => $sidebarTree,
|
||||
'commentsEnabled' => $commentsEnabled,
|
||||
'commentTree' => $commentTree,
|
||||
'pageNav' => $pageNav,
|
||||
'next' => $nextPreviousLocator->getNext(),
|
||||
'previous' => $nextPreviousLocator->getPrevious(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue