BookStack/resources/views/comments/comments.blade.php
Dan Brown 15c39c1976
Updated JS translations to be inserted from back-end
Removes old awkward JS translations endpoint.
New system still a little akward in code but not now in process.

Also extracted out page editors into their own files.

Closes #1258
2019-07-06 14:52:25 +01:00

37 lines
1.3 KiB
PHP

<div page-comments page-id="{{ $page->id }}" class="comments-list">
@exposeTranslations([
'entities.comment_updated_success',
'entities.comment_deleted_success',
'entities.comment_created_success',
'entities.comment_count',
])
<div comment-count-bar 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)
<div class="text-m-right" comment-add-button-container>
<button type="button" action="addComment"
class="button outline">{{ trans('entities.comment_add') }}</button>
</div>
@endif
</div>
<div class="comment-container" comment-container>
@foreach($page->comments as $comment)
@include('comments.comment', ['comment' => $comment])
@endforeach
</div>
@if(userCan('comment-create-all'))
@include('comments.create')
@endif
@if (count($page->comments) > 0)
<div class="text-right" comment-add-button-container>
<button type="button" action="addComment"
class="button outline">{{ trans('entities.comment_add') }}</button>
</div>
@endif
</div>