]> BookStack Code Mirror - bookstack/blob - resources/views/comments/comments.blade.php
Comments: Moved to tab UI, Converted tabs component to ts
[bookstack] / resources / views / comments / comments.blade.php
1 <section components="page-comments tabs"
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_thread_count') }}"
5          option:page-comments:archived-count-text="{{ trans('entities.comment_archived_count') }}"
6          option:page-comments:wysiwyg-language="{{ $locale->htmlLang() }}"
7          option:page-comments:wysiwyg-text-direction="{{ $locale->htmlDirection() }}"
8          class="comments-list tab-container"
9          aria-label="{{ trans('entities.comments') }}">
10
11     <div refs="page-comments@comment-count-bar" class="flex-container-row items-center">
12         <div role="tablist" class="flex">
13             <button type="button"
14                     role="tab"
15                     id="comment-tab-active"
16                     aria-controls="comment-tab-panel-active"
17                     refs="page-comments@active-tab"
18                     aria-selected="true">{{ trans_choice('entities.comment_thread_count', $commentTree->activeThreadCount()) }}</button>
19             <button type="button"
20                     role="tab"
21                     id="comment-tab-archived"
22                     aria-controls="comment-tab-panel-archived"
23                     refs="page-comments@archived-tab"
24                     aria-selected="false">{{ trans_choice('entities.comment_archived_count', count($commentTree->getArchived())) }}</button>
25         </div>
26         @if ($commentTree->empty() && userCan('comment-create-all'))
27             <div class="ml-m" refs="page-comments@add-button-container">
28                 <button type="button"
29                         refs="page-comments@add-comment-button"
30                         class="button outline mb-m">{{ trans('entities.comment_add') }}</button>
31             </div>
32         @endif
33     </div>
34
35     <div id="comment-tab-panel-active"
36          tabindex="0"
37          role="tabpanel"
38          aria-labelledby="comment-tab-active"
39          class="comment-container">
40         <div refs="page-comments@comment-container">
41             @foreach($commentTree->getActive() as $branch)
42                 @include('comments.comment-branch', ['branch' => $branch, 'readOnly' => false])
43             @endforeach
44         </div>
45
46         <p class="text-center text-muted italic empty-state">{{ trans('entities.comment_none') }}</p>
47
48         @if(userCan('comment-create-all'))
49             @include('comments.create')
50             @if (!$commentTree->empty())
51                 <div refs="page-comments@addButtonContainer" class="flex-container-row">
52                     <button type="button"
53                             refs="page-comments@add-comment-button"
54                             class="button outline ml-auto">{{ trans('entities.comment_add') }}</button>
55                 </div>
56             @endif
57         @endif
58     </div>
59
60     <div refs="page-comments@archive-container"
61          id="comment-tab-panel-archived"
62          tabindex="0"
63          role="tabpanel"
64          aria-labelledby="comment-tab-archived"
65          hidden="hidden"
66          class="comment-container">
67         @foreach($commentTree->getArchived() as $branch)
68             @include('comments.comment-branch', ['branch' => $branch, 'readOnly' => false])
69         @endforeach
70             <p class="text-center text-muted italic empty-state">{{ trans('entities.comment_none') }}</p>
71     </div>
72
73     @if(userCan('comment-create-all') || $commentTree->canUpdateAny())
74         @push('body-end')
75             <script src="{{ versioned_asset('libs/tinymce/tinymce.min.js') }}" nonce="{{ $cspNonce }}" defer></script>
76             @include('form.editor-translations')
77             @include('entities.selector-popup')
78         @endpush
79     @endif
80
81 </section>