]> BookStack Code Mirror - bookstack/blob - resources/views/comments/comment.blade.php
Added comment reply and delete confirmation.
[bookstack] / resources / views / comments / comment.blade.php
1 <div class="comment-box" comment="{{ $comment->id }}" local-id="{{$comment->local_id}}" parent-id="{{$comment->parent_id || ''}}" id="comment{{$comment->local_id}}">
2     <div class="header">
3
4         <div class="float right actions">
5             @if(userCan('comment-update', $comment))
6                 <button type="button" class="text-button" action="edit" title="{{ trans('common.edit') }}"><i class="zmdi zmdi-edit"></i></button>
7             @endif
8             @if(userCan('comment-create-all'))
9                 <button type="button" class="text-button" action="reply" title="{{ trans('common.reply') }}"><i class="zmdi zmdi-mail-reply-all"></i></button>
10             @endif
11             @if(userCan('comment-delete', $comment))
12
13                 <div dropdown class="dropdown-container">
14                     <button type="button" dropdown-toggle class="text-button" title="{{ trans('common.delete') }}"><i class="zmdi zmdi-delete"></i></button>
15                     <ul>
16                         <li class="padded"><small class="text-muted">{{trans('entities.comment_delete_confirm')}}</small></li>
17                         <li><a action="delete" class="text-button neg" ><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
18                     </ul>
19                 </div>
20             @endif
21         </div>
22
23         <div class="meta">
24             <a href="#comment{{$comment->local_id}}" class="text-muted">#{{$comment->local_id}}</a>
25             &nbsp;&nbsp;
26             <img width="50" src="{{ $comment->createdBy->getAvatar(50) }}" class="avatar" alt="{{ $comment->createdBy->name }}">
27             &nbsp;
28             <a href="{{ $comment->createdBy->getProfileUrl() }}">{{ $comment->createdBy->name }}</a>
29             {{--TODO - Account for deleted user--}}
30             <span title="{{ $comment->created_at }}">
31             {{ trans('entities.comment_created', ['createDiff' => $comment->created]) }}
32         </span>
33             @if($comment->isUpdated())
34                 <span title="{{ $comment->updated_at }}">
35                 &bull;&nbsp;
36                     {{ trans('entities.comment_updated', ['updateDiff' => $comment->updated, 'username' => $comment->updatedBy->name]) }}
37             </span>
38             @endif
39         </div>
40
41     </div>
42
43     @if ($comment->parent_id)
44         <div class="reply-row primary-background-light text-muted">
45             {!! trans('entities.comment_in_reply_to', ['commentId' => '<a href="#comment'.$comment->parent_id.'">#'.$comment->parent_id.'</a>']) !!}
46         </div>
47     @endif
48
49     <div comment-content class="content">
50         {!! $comment->html  !!}
51     </div>
52
53     @if(userCan('comment-update', $comment))
54         <div comment-edit-container style="display: none;" class="content">
55             <form novalidate>
56                 <div class="form-group">
57                     <textarea name="markdown" rows="3" v-model="comment.text" placeholder="{{ trans('entities.comment_placeholder') }}">{{ $comment->text }}</textarea>
58                 </div>
59                 <div class="form-group text-right">
60                     <button type="button" class="button outline" action="closeUpdateForm">{{ trans('common.cancel') }}</button>
61                     <button type="submit" class="button pos">{{ trans('entities.comment_save') }}</button>
62                 </div>
63             </form>
64         </div>
65     @endif
66
67 </div>