]> BookStack Code Mirror - bookstack/blob - resources/views/comments/comments.blade.php
Comments: Started archive display, created mode for tree node
[bookstack] / resources / views / comments / comments.blade.php
1 <section component="page-comments"
2          option:page-comments:page-id="{{ $page->id }}"
3          option:page-comments:created-text="{{ trans('entities.comment_created_success') }}"
4          option:page-comments:count-text="{{ trans('entities.comment_count') }}"
5          option:page-comments:wysiwyg-language="{{ $locale->htmlLang() }}"
6          option:page-comments:wysiwyg-text-direction="{{ $locale->htmlDirection() }}"
7          class="comments-list"
8          aria-label="{{ trans('entities.comments') }}">
9
10     <div refs="page-comments@comment-count-bar" class="grid half left-focus v-center no-row-gap">
11         <h5 refs="page-comments@comments-title">{{ trans_choice('entities.comment_count', $commentTree->count(), ['count' => $commentTree->count()]) }}</h5>
12         @if ($commentTree->empty() && userCan('comment-create-all'))
13             <div class="text-m-right" refs="page-comments@add-button-container">
14                 <button type="button"
15                         refs="page-comments@add-comment-button"
16                         class="button outline">{{ trans('entities.comment_add') }}</button>
17             </div>
18         @endif
19     </div>
20
21     <div refs="page-comments@comment-container" class="comment-container">
22         @foreach($commentTree->getActive() as $branch)
23             @include('comments.comment-branch', ['branch' => $branch, 'readOnly' => false])
24         @endforeach
25     </div>
26
27     @if(userCan('comment-create-all'))
28         @include('comments.create')
29         @if (!$commentTree->empty())
30             <div refs="page-comments@addButtonContainer" class="flex-container-row">
31
32                 <button type="button"
33                         refs="page-comments@show-archived-button"
34                         class="text-button hover-underline">{{ trans_choice('entities.comment_archived', count($commentTree->getArchived())) }}</button>
35
36                 <button type="button"
37                         refs="page-comments@add-comment-button"
38                         class="button outline ml-auto">{{ trans('entities.comment_add') }}</button>
39             </div>
40         @endif
41     @endif
42
43     <div refs="page-comments@archive-container" class="comment-container">
44         @foreach($commentTree->getArchived() as $branch)
45             @include('comments.comment-branch', ['branch' => $branch, 'readOnly' => false])
46         @endforeach
47     </div>
48
49     @if(userCan('comment-create-all') || $commentTree->canUpdateAny())
50         @push('body-end')
51             <script src="{{ versioned_asset('libs/tinymce/tinymce.min.js') }}" nonce="{{ $cspNonce }}" defer></script>
52             @include('form.editor-translations')
53             @include('entities.selector-popup')
54         @endpush
55     @endif
56
57 </section>