@use('Illuminate\Support\Facades\Storage')
← {{ __('portal.job_back_to_list') }}

{{ __('portal.job_detail_title') }}

@if ($job->ended_at) {{ __('portal.job_detail_pdf_download') }} @endif
{{-- Info Section --}}
{{ __('portal.job_detail_object') }}
{{ $job->customerObject?->name ?? '–' }} @if($job->customerObject?->street) — {{ $job->customerObject->street }}, {{ $job->customerObject->zip }} {{ $job->customerObject->city }} @endif
{{ __('portal.job_detail_type') }}
{{ $job->type->label() }}
{{ __('portal.job_detail_started') }}
{{ $job->localStartedAt()->format('d.m.Y H:i') }}
{{ __('portal.job_detail_ended') }}
{{ $job->localEndedAt()?->format('d.m.Y H:i') ?? '–' }}
{{ __('portal.job_detail_duration') }}
{{ $job->durationFormatted() }}
@if ($driverLastName)
{{ __('portal.job_detail_driver') }}
{{ $driverLastName }}
@endif
{{ __('portal.job_detail_notes') }}
{{ $job->notes ?? __('portal.job_detail_notes_empty') }}
{{-- Weather Section --}}

{{ __('portal.job_detail_weather') }}

@if ($job->weatherSnapshots->isNotEmpty())
@foreach ($job->weatherSnapshots as $snapshot) @if ($snapshot->fetched_at) @else @endif @endforeach
{{ __('weather.col_moment') }} {{ __('weather.col_temperature') }} {{ __('weather.col_precipitation') }} {{ __('weather.col_snow_depth') }} {{ __('weather.col_weather_code') }}
{{ $snapshot->moment->label() }}{{ $snapshot->temperature }} °C {{ $snapshot->precipitation }} mm {{ $snapshot->snow_depth }} cm {{ $snapshot->weather_code }}{{ __('job.weather_not_fetched') }}
@else

{{ __('portal.job_detail_weather_empty') }}

@endif
{{-- Photos Section --}} @if ($customer->portal_show_photos && $job->jobPhotos->isNotEmpty())

{{ __('portal.job_detail_photos') }}

@foreach ($job->jobPhotos as $photo) {{ $photo->caption ?? __('portal.job_detail_photo_alt') }} @endforeach
@elseif ($customer->portal_show_photos)

{{ __('portal.job_detail_photos') }}

{{ __('portal.job_detail_photos_empty') }}

@endif {{-- GPS Map Section --}} @if ($customer->portal_show_gps && $smoothedGps->isNotEmpty())

{{ __('portal.job_detail_gps') }}

@elseif ($customer->portal_show_gps)

{{ __('portal.job_detail_gps') }}

{{ __('portal.job_detail_gps_empty') }}

@endif