@extends('layouts.app') @section('content') @php $locale = app()->getLocale(); $dir = $locale === 'ar' ? 'rtl' : 'ltr'; @endphp
{{ __('site.map_alt') }}
{{ __('site.concours_results_title') }} {{-- dynamic title: try trans_field then fallback to common columns --}}

{{ function_exists('trans_field') ? trans_field($concours, 'titre') : ($concours->titre ?? $concours->titre_G ?? '') }}

{{ __('site.registration_ends') }}: {{ optional($concours->date_fin)->format('Y-m-d') ?? '—' }}

{{ __('site.reset_button') }}
{{-- Show a prompt if user didn't search yet --}} @if(! ($searchRan ?? false) )

{{ __('site.results_prompt') }}

{{ __('site.results_prompt_note') }}
@else {{-- search was run: show table (may be empty if no matches) --}}
{{-- new column --}} @forelse($candidates as $cand) {{-- Actions column: download if PDF exists --}} @empty @endforelse
{{ __('site.table_name') }} {{ __('site.table_cin') }} {{ __('site.table_email') }} {{ __('site.table_status') }} {{ __('site.table_created_at') }} {{ __('site.table_actions') }}
{{ $cand->nom }} {{ $cand->prenom }}
{{ $cand->gouvernorat ?? '—' }}
{{ $cand->cin ?? '—' }} @if($cand->email) {{ $cand->email }} @else — @endif {{ __('site.status_'.$cand->etat) }} {{ optional($cand->created_at)->format('Y-m-d') }} {{-- Download button (only if cin exists) --}} @if($cand->cin) @endif
{{ __('site.no_results') }}
{{ $candidates->appends(request()->except('page'))->links('pagination::bootstrap-5') }}
@endif
@endsection