]> BookStack Code Mirror - bookstack/blob - resources/views/comments/comment.blade.php
Comments: Updated to show form in expected location
[bookstack] / resources / views / comments / comment.blade.php
1 <div component="page-comment"
2      option:page-comment:comment-id="{{ $comment->id }}"
3      option:page-comment:comment-local-id="{{ $comment->local_id }}"
4      option:page-comment:comment-parent-id="{{ $comment->parent_id }}"
5      option:page-comment:updated-text="{{ trans('entities.comment_updated_success') }}"
6      option:page-comment:deleted-text="{{ trans('entities.comment_deleted_success') }}"
7      id="comment{{$comment->local_id}}"
8      class="comment-box">
9     <div class="header p-s">
10         <div class="grid half left-focus no-gap v-center">
11             <div class="meta text-muted text-small">
12                 <a href="#comment{{$comment->local_id}}">#{{$comment->local_id}}</a>
13                 &nbsp;&nbsp;
14                 @if ($comment->createdBy)
15                     <img width="50" src="{{ $comment->createdBy->getAvatar(50) }}" class="avatar" alt="{{ $comment->createdBy->name }}">
16                     &nbsp;
17                     <a href="{{ $comment->createdBy->getProfileUrl() }}">{{ $comment->createdBy->name }}</a>
18                 @else
19                     <span>{{ trans('common.deleted_user') }}</span>
20                 @endif
21                 <span title="{{ $comment->created_at }}">{{ trans('entities.comment_created', ['createDiff' => $comment->created]) }}</span>
22                 @if($comment->isUpdated())
23                     <span title="{{ $comment->updated_at }}">
24                 &bull;&nbsp;
25                     {{ trans('entities.comment_updated', ['updateDiff' => $comment->updated, 'username' => $comment->updatedBy? $comment->updatedBy->name : trans('common.deleted_user')]) }}
26             </span>
27                 @endif
28             </div>
29             <div class="actions text-right">
30                 @if(userCan('comment-update', $comment))
31                     <button refs="page-comment@edit-button" type="button" class="text-button icon p-xs"  aria-label="{{ trans('common.edit') }}" title="{{ trans('common.edit') }}">@icon('edit')</button>
32                 @endif
33                 @if(userCan('comment-create-all'))
34                     <button refs="page-comment@reply-button" type="button" class="text-button icon p-xs" aria-label="{{ trans('common.reply') }}" title="{{ trans('common.reply') }}">@icon('reply')</button>
35                 @endif
36                 @if(userCan('comment-delete', $comment))
37                     <div component="dropdown" class="dropdown-container">
38                         <button type="button" refs="dropdown@toggle" aria-haspopup="true" aria-expanded="false" class="text-button icon p-xs" title="{{ trans('common.delete') }}">@icon('delete')</button>
39                         <ul refs="dropdown@menu" class="dropdown-menu" role="menu">
40                             <li class="px-m text-small text-muted pb-s">{{trans('entities.comment_delete_confirm')}}</li>
41                             <li>
42                                 <button refs="page-comment@delete-button" type="button" class="text-button text-neg icon-item">
43                                     @icon('delete')
44                                     <div>{{ trans('common.delete') }}</div>
45                                 </button>
46                             </li>
47                         </ul>
48                     </div>
49                 @endif
50             </div>
51         </div>
52
53     </div>
54
55     @if ($comment->parent_id)
56         <div class="reply-row primary-background-light text-muted px-s py-xs mb-s">
57             {!! trans('entities.comment_in_reply_to', ['commentId' => '<a href="#comment'.$comment->parent_id.'">#'.$comment->parent_id.'</a>']) !!}
58         </div>
59     @endif
60
61     <div refs="page-comment@content-container" class="content px-s pb-s">
62         {!! $comment->html  !!}
63     </div>
64
65     @if(userCan('comment-update', $comment))
66         <form novalidate refs="page-comment@form" hidden class="content px-s block">
67             <div class="form-group description-input">
68                 <textarea refs="page-comment@input" name="markdown" rows="3" placeholder="{{ trans('entities.comment_placeholder') }}">{{ $comment->text }}</textarea>
69             </div>
70             <div class="form-group text-right">
71                 <button type="button" class="button outline" refs="page-comment@form-cancel">{{ trans('common.cancel') }}</button>
72                 <button type="submit" class="button">{{ trans('entities.comment_save') }}</button>
73             </div>
74         </form>
75     @endif
76
77 </div>