Driver tasks

@if (session('status'))
{{ session('status') }}
@endif @if ($mode === 'day') @php $open = $tasks->whereIn('status', \App\Models\DriverTask::OPEN)->count(); @endphp
{{ $day->format('l, d.m.Y') }} ยท {{ $open }} remaining of {{ $tasks->count() }}
@forelse ($tasks as $t) @php $seen = $views[$t->id] ?? null; $changed = $t->last_other_change && (! $seen || \Illuminate\Support\Carbon::parse($t->last_other_change)->gt($seen)); $isOpen = in_array($t->status, \App\Models\DriverTask::OPEN); @endphp
{{ $t->timeLabel() ?: 'Any time' }} @include('driver-tasks._status', ['status' => $t->status]) @if ($changed)New changes@endif
{{ $t->task }} {{-- Address: its own line, with big navigation buttons below --}} @if ($t->address)
๐Ÿ“ {{ $t->address }}
@include('driver-tasks._navigate', ['task' => $t, 'size' => 'lg'])
@endif {{-- Contact: its own line, the phone is a large tap target --}} @if ($t->contact_person || $t->phone)
@if ($t->contact_person){{ $t->contact_person }}@endif @if ($t->phone) {{ $t->phone }} @endif
@endif @if ($t->order)@endif
@if ($isOpen) @if ($t->status === 'planned')
@csrf @method('PATCH')
@endif
@csrf @method('PATCH')
@else
@csrf @method('PATCH')
@endif
@empty
No tasks for this day.
@endforelse
@else @php $start = $month->copy()->startOfMonth()->startOfWeek(\Illuminate\Support\Carbon::MONDAY); $end = $month->copy()->endOfMonth()->endOfWeek(\Illuminate\Support\Carbon::SUNDAY); @endphp
โ†
{{ $month->format('F Y') }}
โ†’
@foreach (['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] as $d)
{{ $d }}
@endforeach
@for ($d = $start->copy(); $d->lte($end); $d->addDay()) @php $c = $counts[$d->toDateString()] ?? null; $inMonth = $d->month === $month->month; @endphp
{{ $d->day }}
@if ($c)
{{ $c->total }} task{{ $c->total > 1 ? 's' : '' }}@if ((int) $c->open_count > 0) ยท {{ (int) $c->open_count }} open @else ยท all done @endif
@endif
@endfor
@endif
@include('driver-tasks._new-task-modal')