@extends('layouts.dashboard') @section('title', 'Proj Mgr - Task' ) @section('content')
Dashboard

{{ $project->name }}

{{ ucfirst($project->status) }} {{ ucfirst($project->priority) }} priority
Sprints Templates @php $userRoleNames = auth()->user() ? auth()->user()->roles->pluck('name')->map(fn($r) => strtolower($r))->all() : []; $isMasterAdmin = in_array('master admin', $userRoleNames) || in_array('master_admin', $userRoleNames); $canEdit = $isMasterAdmin || $project->created_by === auth()->id() || $project->project_manager_id === auth()->id(); $deleteAllowedRoles = ['admin', 'manager', 'master admin', 'master_admin', 'master-admin']; $canDeleteProject = !empty(array_intersect($userRoleNames, array_map('strtolower', $deleteAllowedRoles))); @endphp @if($canEdit || $canDeleteProject)
@if($canEdit) Edit Project Manage Lists @endif @if($canDeleteProject)
@csrf @method('DELETE')
@endif
@endif

{{ $project->description }}

@if($project->projectManager)
Manager: {{ $project->projectManager->name }}
@endif
Due: {{ $project->due_date ? \Carbon\Carbon::parse($project->due_date)->format('M j') : 'NA' }}
{{ $project->taskLists->sum(function($list) { return $list->tasks->where('task_status', 'approved')->count(); }) }}/{{ $project->taskLists->sum(function($list) { return $list->tasks->count(); }) }} tasks completed
@php $totalTasks = $project->taskLists->sum(function($list) { return $list->tasks->count(); }); $completedTasks = $project->taskLists->sum(function($list) { return $list->tasks->where('task_status', 'approved')->count(); }); $progress = $totalTasks > 0 ? round(($completedTasks / $totalTasks) * 100) : 0; @endphp {{ $progress }}% progress
@if($project->createdBy)
Created by: {{ $project->createdBy->name }}
@endif
@foreach($project->teamMembers->sortBy('name')->take(4) as $member)
{{ strtoupper(substr($member->name, 0, 2)) }}
@endforeach @if($project->teamMembers->count() > 4)
+{{ $project->teamMembers->count() - 4 }}
@endif
Add List
@if($project->attachments->count() > 0)

Project Documents ({{ $project->attachments->count() }})

@foreach($project->attachments as $attachment)

{{ $attachment->original_filename }}

{{ number_format($attachment->size / 1024 / 1024, 2) }} MB โ€ข {{ $attachment->uploader->name ?? 'Unknown' }}
@endforeach
@endif
to
to

Filters apply across all task lists on this project view.

@if($project->taskLists->count() > 0)
@foreach($project->taskLists->sortBy('order') as $taskList) @php $allTasksApproved = $taskList->tasks->count() > 0 && $taskList->tasks->every(function($task) { return $task->task_status === 'approved'; }); $shouldHideList = $taskList->tasks->count() === 0 || $allTasksApproved; @endphp

{{ $taskList->name }}

@if($taskList->description)

{{ $taskList->description }}

@endif
{{ $taskList->tasks->count() }} {{ $taskList->tasks->count() === 1 ? 'task' : 'tasks' }} Add Task
@endforeach
@foreach($project->taskLists->sortBy('order') as $taskList) @php $allTasksApproved = $taskList->tasks->count() > 0 && $taskList->tasks->every(function($task) { return $task->task_status === 'approved'; }); @endphp

{{ $taskList->name }}

@if($taskList->description)

{{ $taskList->description }}

@endif
Add Task
@if($taskList->tasks->count() > 0) @php $priorityOrder = ['urgent' => 0, 'high' => 1, 'medium' => 2, 'low' => 3]; $sortedTasks = $taskList->tasks->sortBy(function($task) use ($priorityOrder) { return $priorityOrder[$task->priority ?? 'medium'] ?? 2; }); @endphp @foreach($sortedTasks as $task)
@if($task->task_type === 'general')๐Ÿ“ @elseif($task->task_type === 'equipmentId')๐Ÿ”ง @elseif($task->task_type === 'customerName')๐Ÿ‘ค @else๐Ÿ“ @endif

{{ $task->title }}

{{ ucfirst($task->priority) }} @if($task->task_status === 'completed_pending_review') Review @else {{ ucfirst(str_replace('_', ' ', $task->task_status)) }} @endif
{!! $task->description ?: '' !!}
@if($task->assignedUser)
{{ strtoupper(substr($task->assignedUser->name, 0, 2)) }}
{{ $task->assignedUser->name }}
@else @if($task->created_by === Auth::id()) Unassigned @else
Unassigned
@endif @endif @if($task->due_date)
Due: {{ \Carbon\Carbon::parse($task->due_date)->format('M j') }}
@endif @if($task->comments->count() > 0)
{{ $task->comments->count() }}
@endif
@if($isMasterAdmin || ($canEdit && $task->created_by === Auth::id()))
Move to:
Loading...
@csrf @method('DELETE')
@endif
@endforeach @else

No tasks in {{ $taskList->name }}

Add a task
@endif
@endforeach
@foreach($project->taskLists->sortBy('order') as $taskList) @php $allTasksApproved = $taskList->tasks->count() > 0 && $taskList->tasks->every(function($task) { return $task->task_status === 'approved'; }); $shouldHideList = $taskList->tasks->count() === 0 || $allTasksApproved; @endphp

{{ $taskList->name }}

@if($taskList->description)

{{ $taskList->description }}

@endif
{{ $taskList->tasks->count() }} {{ $taskList->tasks->count() === 1 ? 'task' : 'tasks' }} Add Task
@if($taskList->tasks->count() > 0) @php $priorityOrder = ['urgent' => 0, 'high' => 1, 'medium' => 2, 'low' => 3]; $sortedTasks = $taskList->tasks->sortBy(function($task) use ($priorityOrder) { return $priorityOrder[$task->priority ?? 'medium'] ?? 2; }); @endphp @foreach($sortedTasks as $task)
@if($task->task_type === 'general')๐Ÿ“ @elseif($task->task_type === 'equipmentId')๐Ÿ”ง @elseif($task->task_type === 'customerName')๐Ÿ‘ค @else๐Ÿ“ @endif

{{ $task->title }}

{{ ucfirst($task->priority) }} @if($task->task_status === 'completed_pending_review') Review @else {{ ucfirst(str_replace('_', ' ', $task->task_status)) }} @endif
{!! $task->description ?: '' !!}
@if($task->assignedUser)
{{ strtoupper(substr($task->assignedUser->name, 0, 2)) }}
{{ $task->assignedUser->name }}
@else @if($task->created_by === Auth::id()) Unassigned @else
Unassigned
@endif @endif @if($task->due_date)
Due: {{ \Carbon\Carbon::parse($task->due_date)->format('M j') }}
@endif @if($task->comments->count() > 0)
{{ $task->comments->count() }}
@endif
@if($isMasterAdmin || ($canEdit && $task->created_by === Auth::id()))
Move to:
Loading...
@csrf @method('DELETE')
@endif
@endforeach @else

No tasks in {{ $taskList->name }}

Add a task
@endif
@endforeach
@else

No Task Lists Yet

Get started by creating your first task list to organize your project tasks. You can create lists like "To Do", "In Progress", "Review", or any custom workflow that fits your project.

Create Your First Task List
@endif
@push('scripts') @endpush @endsection