@extends('layouts.app') @section('title', $project->name) @section('breadcrumb') Projects / {{ $project->name }} @endsection @section('content') {{-- Project Header --}} {{-- View Tabs --}}
Board List Timeline Calendar Activity
{{-- Add Task Form --}}
@csrf
{{-- BOARD VIEW (Kanban) --}} @if($view == 'board')
@php $columns = [ 'todo' => ['label' => 'To Do', 'color' => '#6b7280'], 'in_progress' => ['label' => 'In Progress', 'color' => '#3b82f6'], 'review' => ['label' => 'Review', 'color' => '#f59e0b'], 'completed' => ['label' => 'Completed', 'color' => '#22c55e'], ]; @endphp @foreach($columns as $status => $col)
{{ $col['label'] }} {{ $tasksByStatus[$status]->count() }}
@foreach($tasksByStatus[$status] as $task)
@if($task->tags->count())
@foreach($task->tags as $tag) {{ $tag->name }} @endforeach
@endif
{{ $task->title }}
@endforeach
@endforeach
@endif {{-- LIST VIEW --}} @if($view == 'list')
@forelse($tasks as $task) @empty @endforelse
Task Assignee Due Date Priority Status Actions
{{ $task->title }} @if($task->subtasks->count()) @php $prog = $task->subtask_progress; @endphp
@endif
@if($task->assignee)
{{ $task->assignee->initials }}
{{ $task->assignee->name }}
@else — @endif
@if($task->due_date) {{ $task->due_date->format('M j, Y') }} @else — @endif
{{ ucfirst($task->priority) }}
{{ ucfirst(str_replace('_', ' ', $task->status)) }}
@csrf @method('DELETE')
No tasks yet. Create one above!
{{-- Floating Bulk Action Bar --}}
@endif {{-- TIMELINE VIEW --}} @if($view == 'timeline')
@php $months = []; $startMonth = now()->startOfMonth(); for ($i = 0; $i < 4; $i++) { $months[] = $startMonth->copy()->addMonths($i); } $totalDays = $startMonth->diffInDays($startMonth->copy()->addMonths(4)); @endphp
Task
@foreach($months as $month)
{{ $month->format('M Y') }}
@endforeach
@foreach($tasks as $task)
{{ Str::limit($task->title, 25) }}
@php $taskStart = $task->start_date ?? $task->created_at; $taskEnd = $task->due_date ?? now()->addDays(7); $dayOffset = max(0, $startMonth->diffInDays($taskStart, false)); $duration = max(1, $taskStart->diffInDays($taskEnd)); $leftPercent = ($dayOffset / $totalDays) * 100; $widthPercent = ($duration / $totalDays) * 100; @endphp
{{ Str::limit($task->title, 20) }}
@endforeach
@endif {{-- CALENDAR VIEW --}} @if($view == 'calendar') @php $calMonth = request('month', now()->format('Y-m')); $calDate = \Carbon\Carbon::createFromFormat('Y-m', $calMonth)->startOfMonth(); $prevMonth = $calDate->copy()->subMonth()->format('Y-m'); $nextMonth = $calDate->copy()->addMonth()->format('Y-m'); $startOfCal = $calDate->copy()->startOfWeek(\Carbon\Carbon::SUNDAY); $endOfCal = $calDate->copy()->endOfMonth()->endOfWeek(\Carbon\Carbon::SATURDAY); // Build a map of tasks by date $tasksByDate = $tasks->filter(fn($t) => $t->due_date)->groupBy(fn($t) => $t->due_date->format('Y-m-d')); @endphp

{{ $calDate->format('F Y') }}

Today
{{-- Day headers --}} @foreach(['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] as $dayName)
{{ $dayName }}
@endforeach {{-- Day cells --}} @php $current = $startOfCal->copy(); @endphp @while($current <= $endOfCal) @php $dateKey = $current->format('Y-m-d'); $isToday = $current->isToday(); $isCurrentMonth = $current->month === $calDate->month; $dayTasks = $tasksByDate->get($dateKey, collect()); @endphp
{{ $current->day }}
@foreach($dayTasks->take(3) as $dayTask) {{ Str::limit($dayTask->title, 18) }} @endforeach @if($dayTasks->count() > 3)
+{{ $dayTasks->count() - 3 }} more
@endif
@php $current->addDay(); @endphp @endwhile
@endif {{-- ACTIVITY VIEW --}} @if($view == 'activity')

Project Activity

{{ $activities->count() }} events
@if($activities->count())
@foreach($activities as $activity)
{!! $activity->svg_icon !!}
@if(!$loop->last)
@endif
{{ $activity->causer->name ?? 'System' }} {{ $activity->description }}
{{ ucfirst(str_replace('_', ' ', $activity->action)) }} {{ $activity->created_at->diffForHumans() }}
@endforeach
@else
No activity yet
Activity will appear here as changes are made to this project.
@endif
@endif @endsection @push('scripts') @endpush