]> BookStack Code Mirror - bookstack/blob - resources/views/comments/comment.blade.php
Made some changes to the comment system
[bookstack] / resources / views / comments / comment.blade.php
1 <div class="comment-box" comment="{{ $comment->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                 <button type="button" class="text-button" action="delete" title="{{ trans('common.delete') }}"><i class="zmdi zmdi-delete"></i></button>
13             @endif
14         </div>
15
16         <a href="#comment{{$comment->local_id}}" class="text-muted">#{{$comment->local_id}}</a>
17         &nbsp;&nbsp;
18         <img width="50" src="{{ $comment->createdBy->getAvatar(50) }}" class="avatar" alt="{{ $comment->createdBy->name }}">
19         &nbsp;
20         <a href="{{ $comment->createdBy->getProfileUrl() }}">{{ $comment->createdBy->name }}</a>
21         {{--TODO - Account for deleted user--}}
22         <span title="{{ $comment->created_at }}">
23             {{ trans('entities.comment_created', ['createDiff' => $comment->created]) }}
24         </span>
25         @if($comment->isUpdated())
26             <span title="{{ $comment->updated_at }}">
27                 &bull;&nbsp;
28                {{ trans('entities.comment_updated', ['updateDiff' => $comment->updated, 'username' => $comment->updatedBy->name]) }}
29             </span>
30         @endif
31     </div>
32     <div comment-content class="content">
33         {!! $comment->html  !!}
34     </div>
35
36     @if(userCan('comment-update', $comment))
37         <div comment-edit-container style="display: none;" class="content">
38             <form novalidate>
39                 <div class="form-group">
40                     <textarea name="markdown" rows="3" v-model="comment.text" placeholder="{{ trans('entities.comment_placeholder') }}">{{ $comment->text }}</textarea>
41                 </div>
42                 <div class="form-group text-right">
43                     <button type="button" class="button outline" action="closeUpdateForm">{{ trans('common.cancel') }}</button>
44                     <button type="submit" class="button pos">{{ trans('entities.comment_save') }}</button>
45                 </div>
46             </form>
47         </div>
48     @endif
49
50 </div>