X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/0a06e2bce38284ca09340ac880010f45cb3d6f7a..refs/pull/5721/head:/resources/views/comments/comment.blade.php diff --git a/resources/views/comments/comment.blade.php b/resources/views/comments/comment.blade.php index b68a2fdc8..d70a8c1d9 100644 --- a/resources/views/comments/comment.blade.php +++ b/resources/views/comments/comment.blade.php @@ -1,76 +1,107 @@ -
+@php + $commentHtml = $comment->safeHtml(); +@endphp +
- -
- @if(userCan('comment-update', $comment)) - - @endif - @if(userCan('comment-create-all')) - - @endif - @if(userCan('comment-delete', $comment)) - - - @endif -
- -
- #{{$comment->local_id}} -    +
@if ($comment->createdBy) - {{ $comment->createdBy->name }} -   - {{ $comment->createdBy->name }} - @else - {{ trans('common.deleted_user') }} - @endif - - {{ trans('entities.comment_created', ['createDiff' => $comment->created]) }} - - @if($comment->isUpdated()) - - •  - {{ trans('entities.comment_updated', ['updateDiff' => $comment->updated, 'username' => $comment->updatedBy? $comment->updatedBy->name : trans('common.deleted_user')]) }} - +
+ {{ $comment->createdBy->name }} +
@endif +
+ @if ($comment->createdBy) + {{ $comment->createdBy->getShortName(16) }} + @else + {{ trans('common.deleted_user') }} + @endif +  {{ trans('entities.comment_created', ['createDiff' => $comment->created_at->diffForHumans() ]) }} + @if($comment->isUpdated()) + + + {{ trans('entities.comment_updated_indicator') }} + + @endif +
+
+ @if(!$readOnly && (userCan('comment-create-all') || userCan('comment-update', $comment) || userCan('comment-delete', $comment))) +
+ @if(userCan('comment-create-all')) + + @endif + @if(!$comment->parent_id && (userCan('comment-update', $comment) || userCan('comment-delete', $comment))) + + @endif + @if(userCan('comment-update', $comment)) + + @endif + @if(userCan('comment-delete', $comment)) + + @endif + +  •  + +
+ @endif + +
- @if ($comment->parent_id) -
- {!! trans('entities.comment_in_reply_to', ['commentId' => '#'.$comment->parent_id.'']) !!} -
- @endif - -
- - {!! $comment->html !!} + - @if(userCan('comment-update', $comment)) - + @if(!$readOnly && userCan('comment-update', $comment)) + @endif
\ No newline at end of file