@extends('layouts.app')
@section('title', __('Photos & X-rays').' β '.$patient->full_name)
@section('content')
π· {{ $patient->full_name }}
@include('patients._tabs')
@can('files.manage')
+ {{ __('Upload file') }}
@endcan
{{-- ===== Before / After ===== --}}
{{ __('Before / After') }}
@php($pairs = $afters->filter(fn ($a) => $a->paired_with_id))
@if($pairs->isEmpty() && $befores->isEmpty() && $afters->isEmpty())
{{ __('No photos yet.') }}
@endif
@foreach($pairs as $after)
@php($before = $befores->firstWhere('id', $after->paired_with_id))
@continue(! $before)
@endforeach
{{-- Unpaired photos --}}
@php($unpairedAfters = $afters->whereNull('paired_with_id'))
@if($befores->isNotEmpty() || $unpairedAfters->isNotEmpty())
@foreach($befores->whereNotIn('id', $pairs->pluck('paired_with_id')) as $file)
{{ __('Before photo') }}
@if($file->teeth) π¦· {{ implode('Ψ ', $file->teeth) }} @endif
@can('files.manage')
@if($unpairedAfters->isNotEmpty())
@endif
@endcan
@endforeach
@foreach($unpairedAfters as $file)
{{ __('After photo') }}
@endforeach
@endif
{{-- ===== X-rays ===== --}}
π©» {{ __('X-rays') }}
@if($xrays->isEmpty()){{ __('No X-rays yet.') }}
@endif
@foreach($xrays as $file)
@if($file->isImage())
 }})
@else
π {{ $file->original_name }}
@endif
{{ $file->caption ?? $file->created_at->format('d M Y') }}
@if($file->teeth) Β· π¦· {{ implode('Ψ ', $file->teeth) }} @endif
@can('files.manage')
@endcan
@endforeach
{{-- ===== Viewer modal (zoom & pan) ===== --}}
@push('page-scripts')
@endpush
@endsection