{{-- Progress log: each update with its note and photos. Expects $updates (with user + photos). --}} @forelse ($updates as $u) @php [$label, $tone, $icon] = match ($u->type) { 'completed' => ['Completed', 'success', 'check-circle-fill'], 'reopened' => ['Reopened', 'warning', 'arrow-counterclockwise'], 'status' => ['Status', 'secondary', 'flag'], 'created' => ['Order created', 'secondary', 'plus-circle'], 'assigned' => ['Assigned', 'secondary', 'diagram-2'], default => ['Update', 'primary', 'arrow-up-circle'], }; @endphp
{{ $u->user->name ?? 'Someone' }} {{ $label }}@if (in_array($u->type, ['progress', 'completed'])) · {{ $u->progress }}%@endif @if (! empty($showAssignment) && $u->assignment)via {{ $u->assignment->number() }} · {{ $u->assignment->vendor->name }}@endif {{ $u->created_at->timezone(config('erp.timezone'))->format('d M Y, H:i') }}
@if ($u->note)
{!! nl2br(e($u->note)) !!}
@endif @if ($u->photos->isNotEmpty())
@foreach ($u->photos as $p)
Work photo, {{ $p->created_at->timezone(config('erp.timezone'))->format('d M Y H:i') }}
@if ($p->hasLocation()) {{ number_format($p->latitude, 4) }}, {{ number_format($p->longitude, 4) }}@else No location@endif @if ($p->clockOff())
Phone clock off@endif @if ($p->isOlder())
Older photo@endif
@endforeach
@endif
@empty @endforelse