]> BookStack Code Mirror - bookstack/blob - resources/views/comments/comment.blade.php
Comments: Updated reply-to and general styling
[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="flex-container-row justify-space-between wrap">
11             <div class="meta text-muted flex-container-row items-center">
12                 @if ($comment->createdBy)
13                     <img width="50" src="{{ $comment->createdBy->getAvatar(50) }}" class="avatar mx-xs" alt="{{ $comment->createdBy->name }}">
14                     &nbsp;
15                     <a href="{{ $comment->createdBy->getProfileUrl() }}">{{ $comment->createdBy->getShortName(16) }}</a>
16                 @else
17                     {{ trans('common.deleted_user') }}
18                 @endif
19                 <span title="{{ $comment->created_at }}">&nbsp;{{ trans('entities.comment_created', ['createDiff' => $comment->created]) }}</span>
20                 @if($comment->isUpdated())
21                     <span class="mx-xs">&bull;</span>
22                     <span title="{{ trans('entities.comment_updated', ['updateDiff' => $comment->updated_at, 'username' => $comment->updatedBy->name ?? trans('common.deleted_user')]) }}">
23                  {{ trans('entities.comment_updated_indicator') }}
24                     </span>
25                 @endif
26             </div>
27             <div class="right-meta flex-container-row justify-flex-end items-center px-s">
28                 <div class="actions mr-s">
29                     @if(userCan('comment-create-all'))
30                         <button refs="page-comment@reply-button" type="button" class="text-button text-muted hover-underline p-xs">@icon('reply') {{ trans('common.reply') }}</button>
31                     @endif
32                     @if(userCan('comment-update', $comment))
33                         <button refs="page-comment@edit-button" type="button" class="text-button text-muted hover-underline p-xs">@icon('edit') {{ trans('common.edit') }}</button>
34                     @endif
35                     @if(userCan('comment-delete', $comment))
36                         <div component="dropdown" class="dropdown-container">
37                             <button type="button" refs="dropdown@toggle" aria-haspopup="true" aria-expanded="false" class="text-button text-muted hover-underline p-xs">@icon('delete') {{ trans('common.delete') }}</button>
38                             <ul refs="dropdown@menu" class="dropdown-menu" role="menu">
39                                 <li class="px-m text-small text-muted pb-s">{{trans('entities.comment_delete_confirm')}}</li>
40                                 <li>
41                                     <button refs="page-comment@delete-button" type="button" class="text-button text-neg icon-item">
42                                         @icon('delete')
43                                         <div>{{ trans('common.delete') }}</div>
44                                     </button>
45                                 </li>
46                             </ul>
47                         </div>
48                     @endif
49                     <span class="text-muted">
50                         &nbsp;&bull;&nbsp;
51                     </span>
52                 </div>
53                 <div>
54                     <a class="bold text-muted" href="#comment{{$comment->local_id}}">#{{$comment->local_id}}</a>
55                 </div>
56             </div>
57         </div>
58
59     </div>
60
61     <div refs="page-comment@content-container" class="content px-m py-s">
62         @if ($comment->parent_id)
63             <p class="comment-reply mb-xxs">
64                 <a class="text-muted text-small" href="#comment{{ $comment->parent_id }}">@icon('reply'){{ trans('entities.comment_in_reply_to', ['commentId' => '#' . $comment->parent_id]) }}</a>
65             </p>
66         @endif
67         {!! $comment->html  !!}
68     </div>
69
70     @if(userCan('comment-update', $comment))
71         <form novalidate refs="page-comment@form" hidden class="content pt-s px-s block">
72             <div class="form-group description-input">
73                 <textarea refs="page-comment@input" name="markdown" rows="3" placeholder="{{ trans('entities.comment_placeholder') }}">{{ $comment->text }}</textarea>
74             </div>
75             <div class="form-group text-right">
76                 <button type="button" class="button outline" refs="page-comment@form-cancel">{{ trans('common.cancel') }}</button>
77                 <button type="submit" class="button">{{ trans('entities.comment_save') }}</button>
78             </div>
79         </form>
80     @endif
81
82 </div>