@php use App\Models\AdminTask; $today = now()->startOfDay(); $duePill = function (AdminTask $t) use ($today) { if ($t->isDone()) return ['success', ' Done']; if ($t->due_at === null) return ['neutral', 'No date']; $d = $t->due_at->copy()->startOfDay(); $time = $t->has_time ? ' '.$t->due_at->format('H:i') : ''; if ($d->lt($today)) return ['coral', ' '.$t->due_at->format('D j M').$time]; if ($d->eq($today)) return ['amber', 'Today'.$time]; if ($d->eq($today->copy()->addDay())) return ['sky', 'Tomorrow'.$time]; return ['neutral', $t->due_at->format('D j M').$time]; }; @endphp Tasks & diary {{ $adding ? 'Cancel' : 'Add task' }} {{-- Quick add --}} @if ($adding) Task * @error('title') {{ $message }}@enderror Date Time Priority @foreach (['low' => 'Low', 'normal' => 'Normal', 'high' => 'High'] as $k => $lbl) {{ $lbl }} @endforeach Add @endif {{-- Filter --}} @foreach (['open' => 'Open', 'closed' => 'Closed', 'all' => 'All'] as $key => $label) {{ $label }}@if ($key === 'open' && $openCount) ({{ $openCount }})@endif @endforeach Open task board → {{-- List --}} @forelse ($tasks as $t) @php [$pv, $ph] = $duePill($t); @endphp {{ $t->title }} @if ($t->isInProgress())In progress@endif @if ($t->details){{ \Illuminate\Support\Str::limit($t->details, 70) }}@endif {!! $ph !!} @empty No {{ $filter === 'all' ? '' : $filter }} tasks for this fundraiser. @endforelse
{{ $message }}