@extends('workspace.layouts.workspace') @section('title', 'My Tasks') @section('page-title', 'My Tasks') @section('ws-content') {{-- Add task form --}}

Add New Task

@csrf
{{-- Kanban board --}}
@foreach(['pending'=>'Pending','in_progress'=>'In Progress','done'=>'Done'] as $status => $label) @php $statusTasks = $tasks[$status] ?? collect(); $colors = ['pending'=>'#f59e0b','in_progress'=>'#2d3aff','done'=>'#10b981']; $col = $colors[$status]; @endphp
{{-- Column header --}}
{{ $label }} {{ $statusTasks->count() }}
{{-- Task cards --}}
@forelse($statusTasks as $task)
{{-- Priority indicator --}}

{{ $task->title }}

{{-- Toggle done --}}
@csrf @method('PATCH')
{{-- Delete --}}
@csrf @method('DELETE')
@if($task->description)

{{ Str::limit($task->description, 80) }}

@endif
{{ ucfirst($task->priority) }} @if($task->due_date) {{ $task->due_date->isPast() && $task->status!=='done' ? '⚠' : '📅' }} {{ $task->due_date->format('d M') }} @endif @if($task->status==='done' && $task->completed_at) ✓ {{ $task->completed_at->diffForHumans() }} @endif
{{-- Move to in progress button (for pending tasks) --}} @if($task->status === 'pending')
@csrf @method('PATCH')
@endif
@empty

No {{ strtolower($label) }} tasks

@endforelse
@endforeach
@endsection