mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03: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:
17
resources/views/comments/comment-branch.blade.php
Normal file
17
resources/views/comments/comment-branch.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<div>
|
||||
<div class="mb-m">
|
||||
@include('comments.comment', ['comment' => $branch['comment']])
|
||||
</div>
|
||||
@if(count($branch['children']) > 0)
|
||||
<div class="flex-container-row">
|
||||
<div class="pb-m">
|
||||
<div class="comment-thread-indicator fill-height"></div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
@foreach($branch['children'] as $childBranch)
|
||||
@include('comments.comment-branch', ['branch' => $childBranch])
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
@@ -1,4 +1,4 @@
|
||||
<div class="comment-box mb-m" comment="{{ $comment->id }}" local-id="{{$comment->local_id}}" parent-id="{{$comment->parent_id}}" id="comment{{$comment->local_id}}">
|
||||
<div class="comment-box" comment="{{ $comment->id }}" local-id="{{$comment->local_id}}" parent-id="{{$comment->parent_id}}" id="comment{{$comment->local_id}}">
|
||||
<div class="header p-s">
|
||||
<div class="grid half left-focus no-gap v-center">
|
||||
<div class="meta text-muted text-small">
|
||||
|
@@ -8,8 +8,8 @@
|
||||
aria-label="{{ trans('entities.comments') }}">
|
||||
|
||||
<div refs="page-comments@commentCountBar" class="grid half left-focus v-center no-row-gap">
|
||||
<h5 comments-title>{{ trans_choice('entities.comment_count', count($page->comments), ['count' => count($page->comments)]) }}</h5>
|
||||
@if (count($page->comments) === 0 && userCan('comment-create-all'))
|
||||
<h5 comments-title>{{ trans_choice('entities.comment_count', $commentTree->count(), ['count' => $commentTree->count()]) }}</h5>
|
||||
@if ($commentTree->empty() && userCan('comment-create-all'))
|
||||
<div class="text-m-right" refs="page-comments@addButtonContainer">
|
||||
<button type="button" action="addComment"
|
||||
class="button outline">{{ trans('entities.comment_add') }}</button>
|
||||
@@ -18,15 +18,15 @@
|
||||
</div>
|
||||
|
||||
<div refs="page-comments@commentContainer" class="comment-container">
|
||||
@foreach($page->comments as $comment)
|
||||
@include('comments.comment', ['comment' => $comment])
|
||||
@foreach($commentTree->get() as $branch)
|
||||
@include('comments.comment-branch', ['branch' => $branch])
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@if(userCan('comment-create-all'))
|
||||
@include('comments.create')
|
||||
|
||||
@if (count($page->comments) > 0)
|
||||
@if (!$commentTree->empty())
|
||||
<div refs="page-comments@addButtonContainer" class="text-right">
|
||||
<button type="button" action="addComment"
|
||||
class="button outline">{{ trans('entities.comment_add') }}</button>
|
||||
|
@@ -27,7 +27,7 @@
|
||||
|
||||
@include('entities.sibling-navigation', ['next' => $next, 'previous' => $previous])
|
||||
|
||||
@if ($commentsEnabled)
|
||||
@if ($commentTree->enabled())
|
||||
@if(($previous || $next))
|
||||
<div class="px-xl">
|
||||
<hr class="darker">
|
||||
@@ -35,7 +35,7 @@
|
||||
@endif
|
||||
|
||||
<div class="px-xl comments-container mb-l print-hidden">
|
||||
@include('comments.comments', ['page' => $page])
|
||||
@include('comments.comments', ['commentTree' => $commentTree, 'page' => $page])
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
@endif
|
||||
|
Reference in New Issue
Block a user