]> BookStack Code Mirror - bookstack/blob - resources/views/comments/comment.blade.php
Finished migrated from icon-font to SVG
[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') }}">@icon('edit')</button>
7             @endif
8             @if(userCan('comment-create-all'))
9                 <button type="button" class="text-button" action="reply" title="{{ trans('common.reply') }}">@icon('reply')</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') }}">@icon('delete')</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" >@icon('delete'){{ 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             @if ($comment->createdBy)
27                 <img width="50" src="{{ $comment->createdBy->getAvatar(50) }}" class="avatar" alt="{{ $comment->createdBy->name }}">
28                 &nbsp;
29                 <a href="{{ $comment->createdBy->getProfileUrl() }}">{{ $comment->createdBy->name }}</a>
30             @else
31                 <span>{{ trans('common.deleted_user') }}</span>
32             @endif
33             <span title="{{ $comment->created_at }}">
34             {{ trans('entities.comment_created', ['createDiff' => $comment->created]) }}
35         </span>
36             @if($comment->isUpdated())
37                 <span title="{{ $comment->updated_at }}">
38                 &bull;&nbsp;
39                     {{ trans('entities.comment_updated', ['updateDiff' => $comment->updated, 'username' => $comment->updatedBy? $comment->updatedBy->name : trans('common.deleted_user')]) }}
40             </span>
41             @endif
42         </div>
43
44     </div>
45
46     @if ($comment->parent_id)
47         <div class="reply-row primary-background-light text-muted">
48             {!! trans('entities.comment_in_reply_to', ['commentId' => '<a href="#comment'.$comment->parent_id.'">#'.$comment->parent_id.'</a>']) !!}
49         </div>
50     @endif
51
52     <div comment-content class="content">
53         <div class="form-group loading" style="display: none;">
54             @include('partials.loading-icon', ['text' => trans('entities.comment_deleting')])
55         </div>
56         {!! $comment->html  !!}
57     </div>
58
59     @if(userCan('comment-update', $comment))
60         <div comment-edit-container style="display: none;" class="content">
61             <form novalidate>
62                 <div class="form-group">
63                     <textarea name="markdown" rows="3" v-model="comment.text" placeholder="{{ trans('entities.comment_placeholder') }}">{{ $comment->text }}</textarea>
64                 </div>
65                 <div class="form-group text-right">
66                     <button type="button" class="button outline" action="closeUpdateForm">{{ trans('common.cancel') }}</button>
67                     <button type="submit" class="button pos">{{ trans('entities.comment_save') }}</button>
68                 </div>
69                 <div class="form-group loading" style="display: none;">
70                     @include('partials.loading-icon', ['text' => trans('entities.comment_saving')])
71                 </div>
72             </form>
73         </div>
74     @endif
75
76 </div>