]> BookStack Code Mirror - bookstack/blob - resources/views/comments/comments.blade.php
Opensearch: Fixed XML declaration when php short tags enabled
[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 refs="page-comments@add-button-container" class="ml-m flex-container-row" >
28                 <button type="button"
29                         refs="page-comments@add-comment-button"
30                         class="button outline mb-m ml-auto">{{ trans('entities.comment_add') }}</button>
31             </div>
32         @endif
33     </div>
34
35     <div id="comment-tab-panel-active"
36          refs="page-comments@active-container"
37          tabindex="0"
38          role="tabpanel"
39          aria-labelledby="comment-tab-active"
40          class="comment-container no-outline">
41         <div refs="page-comments@comment-container">
42             @foreach($commentTree->getActive() as $branch)
43                 @include('comments.comment-branch', ['branch' => $branch, 'readOnly' => false])
44             @endforeach
45         </div>
46
47         <p class="text-center text-muted italic empty-state">{{ trans('entities.comment_none') }}</p>
48
49         @if(userCan('comment-create-all'))
50             @include('comments.create')
51             @if (!$commentTree->empty())
52                 <div refs="page-comments@addButtonContainer" class="ml-m flex-container-row">
53                     <button type="button"
54                             refs="page-comments@add-comment-button"
55                             class="button outline mb-m ml-auto">{{ trans('entities.comment_add') }}</button>
56                 </div>
57             @endif
58         @endif
59     </div>
60
61     <div refs="page-comments@archive-container"
62          id="comment-tab-panel-archived"
63          tabindex="0"
64          role="tabpanel"
65          aria-labelledby="comment-tab-archived"
66          hidden="hidden"
67          class="comment-container no-outline">
68         @foreach($commentTree->getArchived() as $branch)
69             @include('comments.comment-branch', ['branch' => $branch, 'readOnly' => false])
70         @endforeach
71             <p class="text-center text-muted italic empty-state">{{ trans('entities.comment_none') }}</p>
72     </div>
73
74     @if(userCan('comment-create-all') || $commentTree->canUpdateAny())
75         @push('body-end')
76             <script src="{{ versioned_asset('libs/tinymce/tinymce.min.js') }}" nonce="{{ $cspNonce }}" defer></script>
77             @include('form.editor-translations')
78             @include('entities.selector-popup')
79         @endpush
80     @endif
81
82 </section>