@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) --}} @php $showTemplateColumn = true; if ($candidates->count() == 0) { $showTemplateColumn = false; } else { foreach ($candidates as $c) { if (empty($c->has_published_template)) { $showTemplateColumn = false; break; } } } @endphp
@if($showTemplateColumn) @endif @forelse($candidates as $cand) {{-- Template column --}} {{-- Result (dynamic) column --}} @if($showTemplateColumn) @endif @empty @endforelse
{{ __('site.table_name') }} {{ __('site.table_cin') }} {{ __('site.table_email') }} {{ __('site.table_status') }} {{ __('site.table_created_at') }} {{ __('site.table_result') }}{{ __('site.table_template') }}
{{ $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') }} @if($cand->cin) {{ __('site.download_pdf') ?? 'Download PDF' }} @else @endif @if($cand->cin && !empty($cand->has_published_template)) {{ __('site.view_pdf') ?? 'View PDF' }} @else @endif
{{ __('site.no_results') }}
{{ $candidates->appends(request()->except('page'))->links('pagination::bootstrap-5') }}
@endif
@endsection