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