Task List

@if($viewMode === 'list')
@forelse($categories as $category) @php $categoryTasks = $category->tasks; $totalTasks = $categoryTasks->count(); $completedTasks = $categoryTasks->where('is_completed', true)->count(); $progressPercent = $totalTasks > 0 ? round(($completedTasks / $totalTasks) * 100) : 0; $isCollapsed = in_array($category->id, $collapsedGroups); @endphp

{{ $category->name }}

{{ $totalTasks }} task{{ $totalTasks !== 1 ? 's' : '' }}
{{ $progressPercent }}% complete
@if(!$isCollapsed)
@foreach($categoryTasks as $task)
is_completed ? 'checked' : '' }} class="w-5 h-5 text-green-600 border-gray-300 rounded-full focus:ring-green-500 cursor-pointer">
{{ $task->title }}
@if($task->priority === 'high') High @endif
@if($task->description)

{{ $task->description }}

@endif
@if($task->subTasks->count() > 0) Sub-tasks: {{ $task->subTasks->where('is_completed', true)->count() }}/{{ $task->subTasks->count() }} @endif @if($task->due_date)
Due {{ $task->due_date->format('M d, Y') }} @if($task->due_date->isPast() && !$task->is_completed) ({{ round(abs($task->due_date->diffInDays())) }} days overdue) @endif
@endif @if($task->assignedUsers->count() > 0)
{{ $task->assignedUsers->pluck('name')->join(', ') }}
@endif
@if($task->subTasks->count() > 0)
{{ $task->progress }}%
@endif @if($task->subTasks->count() > 0)
@foreach($task->subTasks as $subTask)
is_completed ? 'checked' : '' }} class="w-4 h-4 text-green-600 border-gray-300 rounded-full focus:ring-green-500 cursor-pointer"> {{ $subTask->title }}
@endforeach
@endif
@endforeach
@endif
@empty

No tasks yet

Get started by adding your first task

@endforelse
@endif @if($viewMode === 'board')
@forelse($categories as $category) @php $categoryTasks = $category->tasks; $taskCount = $categoryTasks->count(); @endphp

{{ $category->name }}

{{ $taskCount }}
@foreach($categoryTasks as $task)

{{ $task->title }}

@if($task->description)

{{ $task->description }}

@endif
@if($task->assignedUsers->count() > 0)
@foreach($task->assignedUsers->take(3) as $user)
{{ strtoupper(substr($user->name, 0, 1)) }}
@endforeach @if($task->assignedUsers->count() > 3)
+{{ $task->assignedUsers->count() - 3 }}
@endif
@if($task->assignedUsers->count() === 1) {{ explode(' ', $task->assignedUsers->first()->name)[0] }} @endif
@else Unassigned @endif @if($task->priority === 'high') High @endif
@if($task->due_date)
{{ $task->due_date->format('n/j/Y') }}
@endif @if($task->subTasks->count() > 0)
{{ $task->subTasks->where('is_completed', true)->count() }}/{{ $task->subTasks->count() }}
@endif @if($task->status === 'in_progress') In Progress @elseif($task->is_completed) Completed @endif
@endforeach
@empty

No tasks yet

Add your first task to get started

@endforelse
@endif
@assets @endassets @script @endscript