@extends('layouts.app') @section('title', $isMyTasks ? 'My Tasks' : 'Dashboard') @section('breadcrumb') {{ $isMyTasks ? 'My Tasks' : 'Home' }} @endsection @section('content') {{-- Header --}}
@if($isMyTasks)

My Tasks

All tasks assigned to you across projects.

@else

Good {{ now()->hour < 12 ? 'morning' : (now()->hour < 17 ? 'afternoon' : 'evening') }}, {{ explode(' ', auth()->user()->name)[0] }} 👋

Here's what's happening with your projects today.

@endif
{{-- Stats Cards --}}
{{ $stats['total_tasks'] }}
Total Tasks
{{ $stats['completed_tasks'] }}
Completed
{{ $stats['overdue_tasks'] }}
Overdue
{{ $stats['active_projects'] }}
Active Projects
@if($isMyTasks) {{-- ============ MY TASKS VIEW ============ --}} {{-- Overdue Tasks --}} @if($overdueTasks->count() > 0)

⚠️ Overdue

{{ $overdueTasks->count() }}
@foreach($overdueTasks as $task)
{{ $task->title }}
{{ $task->project->name ?? '' }} {{ $task->due_date->format('M j') }} — overdue
@endforeach
@endif {{-- In Progress Tasks --}}

🔧 In Progress

{{ $myTasks->where('status', 'in_progress')->count() }}
@forelse($myTasks->where('status', 'in_progress') as $task)
{{ $task->title }}
{{ $task->project->name ?? '' }} @if($task->due_date) {{ $task->due_date->format('M j') }} @endif
In Progress
@empty
No in-progress tasks
@endforelse
{{-- To Do Tasks --}}

📋 To Do

{{ $myTasks->where('status', 'todo')->count() }}
@forelse($myTasks->where('status', 'todo') as $task)
{{ $task->title }}
{{ $task->project->name ?? '' }} @if($task->due_date) {{ $task->due_date->format('M j') }} @endif
To Do
@empty
No to-do tasks
@endforelse
{{-- Review Tasks --}} @if($myTasks->where('status', 'review')->count() > 0)

👀 In Review

{{ $myTasks->where('status', 'review')->count() }}
@foreach($myTasks->where('status', 'review') as $task)
{{ $task->title }}
{{ $task->project->name ?? '' }} @if($task->due_date) {{ $task->due_date->format('M j') }} @endif
Review
@endforeach
@endif {{-- Recently Completed --}} @if($completedTasks->count() > 0)

✅ Recently Completed

{{ $completedTasks->count() }}
@foreach($completedTasks as $task)
{{ $task->title }}
{{ $task->project->name ?? '' }} @if($task->completed_at) Completed {{ $task->completed_at->diffForHumans() }} @endif
Done
@endforeach
@endif @else {{-- ============ HOME DASHBOARD VIEW ============ --}} {{-- Charts Section --}} @if($chartData)
{{-- Weekly Completion Trend --}}

Weekly Trend

{{-- Task Distribution --}}

Task Distribution

{{-- Team Workload --}}

Team Workload

@endif
{{-- Left column --}}
{{-- My Tasks (limited) --}}

My Tasks

{{ $myTasks->count() }} View All
@forelse($myTasks as $task)
{{ $task->title }}
{{ $task->project->name ?? '' }} @if($task->due_date) {{ $task->due_date->format('M j') }} @endif
{{ ucfirst(str_replace('_', ' ', $task->status)) }}
@empty
You're all caught up!
No tasks assigned to you right now.
@endforelse
{{-- Overdue Tasks --}} @if($overdueTasks->count() > 0)

⚠️ Overdue Tasks

{{ $overdueTasks->count() }}
@foreach($overdueTasks as $task)
{{ $task->title }}
{{ $task->project->name ?? '' }} {{ $task->due_date->format('M j') }} — overdue
@endforeach
@endif {{-- Project Progress --}}
{{-- Right column — Activity Feed --}}

Recent Activity

    @forelse($activities as $activity)
  • @if($activity->causer)
    {{ $activity->causer->initials }}
    @else @endif
    {{ $activity->causer->name ?? 'System' }} {{ $activity->description }}
    {{ $activity->created_at->diffForHumans() }}
  • @empty
  • No recent activity
  • @endforelse
{{-- Upcoming Tasks --}} @if($upcomingTasks->count() > 0)

📅 Upcoming (7 days)

{{ $upcomingTasks->count() }}
@foreach($upcomingTasks as $task)
{{ $task->title }}
{{ $task->due_date->format('M j') }}
@endforeach
@endif
@endif @endsection @if(!$isMyTasks && $chartData) @push('scripts') @endpush @endif