@extends('layouts.app') @section('title', 'Tasks') @section('page-title', 'Tasks') @section('content')
{{ auth()->user()->canManageTasks() ? 'All Tasks' : 'My Tasks' }} Create Task
@if(auth()->user()->canManageTasks())
@endif
@if(auth()->user()->canManageTasks() || auth()->user()->isMarketing()) @endif @forelse($tasks as $task) @if(auth()->user()->canManageTasks() || auth()->user()->isMarketing()) @endif @empty @endforelse
# Task TitleAssigned ToPriority Planned Start Planned End Actual Start Status Actions
{{ $task->id }} {{ Str::limit($task->title, 40) }} @if($task->isOverdue()) OVERDUE @endif
{{ strtoupper(substr($task->assignedUser->name, 0, 1)) }}
{{ $task->assignedUser->name }}
{{ $task->priority }} {{ $task->planned_start->format('d M Y') }} {{ $task->planned_end->format('d M Y') }} {{ $task->actual_start ? $task->actual_start->format('d M Y') : '—' }} {{ str_replace('_', ' ', ucfirst($task->status)) }}
{{-- Quick action buttons based on status --}} @if($task->assigned_to === auth()->id() || auth()->user()->canManageTasks()) @if($task->status === 'pending')
@csrf @method('PATCH')
@elseif($task->status === 'in_progress')
@csrf @method('PATCH')
@elseif($task->status === 'rejected')
@csrf @method('PATCH')
@endif @endif @if(!in_array($task->status, ['approved', 'completed'])) @endif @if(auth()->user()->canManageTasks())
@csrf @method('DELETE')
@endif
No tasks found.
@if($tasks->hasPages()) @endif
@endsection