@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)) )
@php $userRoles = user_roles(); $isAdmin = in_array('admin', $userRoles); $isEmployee = in_array('employee', $userRoles); @endphp @if ($task->approval_send == 1 && $task->project->need_approval_by_admin == 1 && $isEmployee && !$isAdmin && $status->slug == 'waiting_approval') @include('tasks.ajax.sent-approval-modal') @else
{{ user()->name }}
@lang('app.cancel') @lang('app.submit')
@endif @endif
@forelse ($task->comments as $comment)
{{ $comment->user->name }}

{{ $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
{!! $comment->comment !!}
@empty
- @lang('messages.noCommentFound') -
@endforelse