@php($mayEdit=!$task->archived_at && $access->edit(auth()->user(),$task)) @php($mayUpdate=!$task->archived_at && $access->update(auth()->user(),$task))
{{ \App\Models\WorkTask::STATUSES[$task->status] }}

{{ $task->title }}

Created by {{ $task->creator?->name ?? 'Company user' }}@if($task->archived_at) · Archived @endif

{{ $task->description ?: 'No description provided.' }}

Assignees: {{ $task->assignees->map(fn($a)=>$a->employee?->full_name)->filter()->join(', ') ?: 'Personal task' }}

Due date: {{ $task->due_on?->format('d M Y') ?? 'Not set' }} · Priority: {{ ucfirst($task->priority) }}

@if($mayUpdate)
@csrf
@endif

Checklist · {{ $task->checklist_done_count }}/{{ $task->checklist_count }}

@foreach($items as $item)
@if($mayUpdate)
@csrf{{ $item->label }}
@else{{ $item->done?'✓':'○' }} {{ $item->label }}@endif
@endforeach @if($mayUpdate)
@csrf
Checklist progress does not approve an HR workflow or prevent task completion.@endif @if($mayEdit)
Edit task and assignees
@csrf@include('tasks.assignees',['selected'=>$task->assignees->pluck('employee_id')->all()])
@csrf
@endif

Comments

@foreach($comments as $comment)
{{ $comment->user?->name ?? 'Company user' }}

{{ $comment->body }}

{{ $comment->created_at->format('d M Y H:i') }} UTC
@endforeach@if(!$task->archived_at)
@csrf
@endif

Activity history

@foreach($events as $event)
{{ ucwords(str_replace('_',' ',$event->event)) }}

{{ $event->user?->name ?? 'System' }} · {{ $event->created_at->format('d M Y H:i') }} UTC

@if(isset($event->data['from']))

{{ \App\Models\WorkTask::STATUSES[$event->data['from']] ?? $event->data['from'] }} → {{ \App\Models\WorkTask::STATUSES[$event->data['to']] ?? $event->data['to'] }}

@endif
@endforeach