@extends('layouts.app') @section('content') @php $locale = app()->getLocale(); $dir = $locale === 'ar' ? 'rtl' : 'ltr'; @endphp
{{ __('site.map_alt') }}
{{ __('site.services_subtitle') }}

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

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

{{ __('site.reset_button') }}
{{-- Grid of concours --}}
@forelse($concours as $c)
{{-- dynamic title: try localized column first --}}

{{ trans_field($c, 'titre') ?? $c->titre }}

{{ __('site.registration_ends') }}: @if(!empty($c->date_fin)) {{ \Carbon\Carbon::parse($c->date_fin)->format('Y-m-d') }} @else — @endif

@php // try localized description (use trans_field if available) $shortDesc = null; if (function_exists('trans_field')) { $raw = trans_field($c, 'description') ?? trans_field($c, 'resume') ?? ($c->description ?? null); } else { $raw = $c->description ?? null; } if ($raw) { $shortDesc = \Illuminate\Support\Str::limit(strip_tags($raw), 120); } @endphp @if($shortDesc)

{{ $shortDesc }}

@endif @php // determine if concours is still open (no date_fin = open) $isOpen = empty($c->date_fin) ? true : \Carbon\Carbon::parse($c->date_fin)->endOfDay()->gte(\Carbon\Carbon::now()); @endphp
@if($isOpen) {{ __('site.register_button') }} @else {{ __('site.registration_closed') }} @endif {{ __('site.results_button') }}
@empty

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

@endforelse
{{ $concours->appends(request()->except('page'))->links('pagination::bootstrap-5') }}
@endsection