{{ get_label('discussions', 'Discussions') }} : {{ $project->title }}
@if (isset($project->comments) && $project->comments->isNotEmpty()) @foreach ($project->comments->whereNull('parent_id')->reverse()->take(5) as $comment)
{{ get_label('jump_to_comment', 'Jump to Comment') }}-{{ $comment->id }}
{{ isset($comment->commenter->first_name) && isset($comment->commenter->last_name) ? $comment->commenter->first_name . ' ' . $comment->commenter->last_name : get_label('unknown_user', 'Unknown User') }}
@php $isClient = $comment->commenter_type == 'App\\Models\\Client'; $entity = $comment->commenter; $hasPermission = $isClient ? checkPermission('manage_clients') : checkPermission('manage_users'); $profileRoute = $hasPermission && isset($entity->id) ? route($isClient ? 'clients.profile' : 'users.profile', [$entity->id]) : null; $fullName = isset($entity->first_name) && isset($entity->last_name) ? $entity->first_name . ' ' . $entity->last_name : get_label('unknown_user', 'Unknown User'); @endphp @if ($profileRoute && $fullName != get_label('unknown_user', 'Unknown User')) {{ $fullName }} @else {{ $fullName }} @endif

{{ isset($comment->created_at) ? $comment->created_at->diffForHumans() : '' }} @if (isset($comment->created_at) && $comment->created_at != $comment->updated_at) ({{ get_label('edited', 'Edited') }}) @endif

@if (isAdminOrHasAllDataAccess()) @endif

{!! isset($comment->content) ? $comment->content : '' !!}

@if (isset($comment->attachments) && $comment->attachments->isNotEmpty())
@foreach ($comment->attachments as $attachment) @endforeach
@endif
@if (isset($comment->children) && $comment->children->count() > 0)
@foreach ($comment->children->reverse() as $reply)
{{ get_label('jump_to_comment', 'Jump to Comment') }}-{{ $reply->id }}
{{ isset($reply->commenter->first_name) && isset($reply->commenter->last_name) ? $reply->commenter->first_name . ' ' . $reply->commenter->last_name : get_label('unknown_user', 'Unknown User') }}
@php $isClient = $reply->commenter_type == 'App\\Models\\Client'; $entity = $reply->commenter; $hasPermission = $isClient ? checkPermission('manage_clients') : checkPermission('manage_users'); $profileRoute = $hasPermission && isset($entity->id) ? route($isClient ? 'clients.profile' : 'users.profile', [$entity->id]) : null; $fullName = isset($entity->first_name) && isset($entity->last_name) ? $entity->first_name . ' ' . $entity->last_name : get_label('unknown_user', 'Unknown User'); @endphp @if ($profileRoute && $fullName != get_label('unknown_user', 'Unknown User')) {{ $fullName }} @else {{ $fullName }} @endif

{{ isset($reply->created_at) ? $reply->created_at->diffForHumans() : '' }} @if (isset($reply->created_at) && $reply->created_at != $reply->updated_at) ({{ get_label('edited', 'Edited') }}) @endif

@if (isAdminOrHasAllDataAccess()) @endif

{!! isset($reply->content) ? $reply->content : '' !!}

@if (isset($reply->attachments) && $reply->attachments->isNotEmpty())
@foreach ($reply->attachments as $attachment) @endforeach
@endif
@endforeach
@endif
@endforeach @else

{{ get_label('no_comments', 'No Comments') }}

@endif
@if (isset($project->comments) && $project->comments->count() > 5)
@endif