@extends('layouts.app') @section('page_title', !$activeProject ? 'All Tasks' : $activeProject->name) @section('content')

Projects

All Projects

{{ $tasks->count() }} tasks

@if($projects->isEmpty())

No projects yet

Create First Project
@else @foreach($projects as $project)

{{ $project->name }}

{{ $project->tasks_count }} tasks

@endforeach @endif

@if($activeProject) {{ $activeProject->name }} @else All Tasks @endif

@if($activeProject && $activeProject->description)

{{ $activeProject->description }}

@elseif(!$activeProject)

View and manage all your tasks across all projects

@endif
+ Add Task @if($activeProject) Edit
@csrf @method('DELETE')
@endif

Total Tasks

{{ collect($groupedTasks)->flatten()->count() }}

Pending

{{ $groupedTasks['pending']->count() }}

Completed

{{ $groupedTasks['completed']->count() }}

@if($tasks->isEmpty())

@if($activeProject) No tasks yet in this project @else No tasks yet @endif

Create the first task →
@else
@foreach(['pending' => 'To Do', 'in_progress' => 'In Progress', 'completed' => 'Completed'] as $statusKey => $statusLabel) @php $statusTasks = $groupedTasks[$statusKey] ?? collect(); $taskCount = $statusTasks->count(); $statusColors = [ 'pending' => 'blue', 'in_progress' => 'amber', 'completed' => 'green' ]; $color = $statusColors[$statusKey] ?? 'gray'; @endphp
@if($taskCount > 0)
@if(!$activeProject) @endif @foreach($statusTasks as $task) @if(!$activeProject) @endif @endforeach
NameProjectPriority Start Due Date Time Spent Status Action
{{ $task->title }} @if($task->project) {{ $task->project->name }} @else No Project @endif @php $priorityClasses = [ 'high' => 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300', 'medium' => 'bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300', 'low' => 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300', ]; $priorityClass = $priorityClasses[$task->priority] ?? 'bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300'; @endphp {{ ucfirst($task->priority) }} {{ $task->created_at ? $task->created_at->format('M d, Y') : '-' }} @if($task->due_date) {{ $task->due_date->format('M d, Y') }} @else - @endif @php $hours = intval($task->time_spent); $minutes = intval(($task->time_spent - $hours) * 60); $totalMinutes = round($task->time_spent * 60); @endphp @if($task->time_spent > 0)
@if($hours > 0) {{ $hours }}h {{ $minutes }}m @else {{ $minutes }}m @endif @if($task->is_tracking) tracking @endif
@else - @endif
View →
@else

No tasks in this section

@endif
@endforeach
@endif
@endsection