@php $addTaskCommentPermission = user()->permission('add_task_comments'); $editTaskCommentPermission = user()->permission('edit_task_comments'); $deleteTaskCommentPermission = user()->permission('delete_task_comments'); @endphp
@if ($addTaskCommentPermission == 'all' || ($addTaskCommentPermission == 'added' && $task->added_by == user()->id) || ($addTaskCommentPermission == 'owned' && in_array(user()->id, $taskUsers)) || ($addTaskCommentPermission == 'both' && (in_array(user()->id, $taskUsers) || $task->added_by == user()->id)) )
{{ mb_ucfirst(user()->name) }}
@lang('app.cancel') @lang('app.submit')
@endif
@forelse ($task->comments as $comment)
{{ mb_ucwords($comment->user->name) }}

{{ mb_ucwords($comment->user->name) }}

{{$comment->created_at->timezone(company()->timezone)->diffForHumans()}}
@if ($editTaskCommentPermission == 'all' || ($editTaskCommentPermission == 'added' && $comment->added_by == user()->id)) @endif @if ($deleteTaskCommentPermission == 'all' || ($deleteTaskCommentPermission == 'added' && $comment->added_by == user()->id)) @endif
@php $likeUsers = $comment->likeUsers->pluck('name')->toArray(); $likeUserList = ''; if($likeUsers) { if(in_array(user()->name, $likeUsers)){ $key = array_search(user()->name, $likeUsers); array_splice( $likeUsers, 0, 0, __('modules.tasks.you') ); unset($likeUsers[$key+1]); } $likeUserList = implode(', ', $likeUsers); } $dislikeUsers = $comment->dislikeUsers->pluck('name')->toArray(); $dislikeUserList = ''; if($dislikeUsers) { if(in_array(user()->name, $dislikeUsers)){ $key = array_search (user()->name, $dislikeUsers); array_splice( $dislikeUsers, 0, 0, __('modules.tasks.you') ); unset($dislikeUsers[$key+1]); } $dislikeUserList = implode(', ', $dislikeUsers); } @endphp
{!! ucfirst($comment->comment) !!}
@empty
- @lang('messages.noCommentFound') -
@endforelse