@extends('layouts.public-layout') @section('title', $church->name . ' - Nos Églises - MMPV') @section('content')
@if($church->image)
{{ $church->name }}
@else
@endif

{{ $church->name }}

{{ $church->city }}, {{ $church->country }}
@if($church->description)

À propos

{{ $church->description }}

@endif @php $now = \Carbon\Carbon::now(); $ongoingEvents = $church->events->filter(function($event) use ($now) { $eventDate = \Carbon\Carbon::parse($event->event_date); $endDate = $event->end_date ? \Carbon\Carbon::parse($event->end_date) : null; // Un événement est "en cours" si: // 1. Il a une end_date et on est entre event_date et end_date if ($endDate && $now->between($eventDate, $endDate)) { return true; } // 2. OU si l'événement est aujourd'hui (sans end_date) if (!$endDate && $eventDate->isToday()) { return true; } return false; }); @endphp @if($ongoingEvents->count() > 0)

Événements en cours

@foreach($ongoingEvents as $event)
En cours

{{ $event->title }}

@if($event->description)

{{ $event->description }}

@if(strlen($event->description) > 150) @endif
@endif
{{ \Carbon\Carbon::parse($event->event_date)->locale('fr')->isoFormat('D MMM YYYY') }} @if($event->event_time) {{ \Carbon\Carbon::parse($event->event_time)->format('H:i') }} @if($event->end_time) - {{ \Carbon\Carbon::parse($event->end_time)->format('H:i') }} @endif @endif @if($event->location) {{ $event->location }} @endif
Détails
@endforeach
@endif @php $upcomingEvents = $church->events->filter(function($event) use ($now) { $eventDate = \Carbon\Carbon::parse($event->event_date); $endDate = $event->end_date ? \Carbon\Carbon::parse($event->end_date) : null; // Event is upcoming if start date is in the future if ($eventDate->isFuture()) { return true; } // Or if it has an end_date and we're not in the event period yet return false; })->sortBy('event_date')->take(5); @endphp

Événements à venir

@if($upcomingEvents->count() > 0)
@foreach($upcomingEvents as $event)

{{ $event->title }}

@if($event->description)

{{ $event->description }}

@if(strlen($event->description) > 100) @endif
@endif
@if($event->is_recurring) Récurrent @endif {{ \Carbon\Carbon::parse($event->event_date)->format('d M Y') }} @if($event->event_time) {{ \Carbon\Carbon::parse($event->event_time)->format('H:i') }} @if($event->end_time) - {{ \Carbon\Carbon::parse($event->end_time)->format('H:i') }} @endif @endif @if($event->location) {{ $event->location }} @endif
@if($event->is_recurring && $event->getRecurrenceDescription())

{{ $event->getRecurrenceDescription() }}

@endif
Détails
@endforeach
@if($church->events->where('status', 'upcoming')->count() > 5) @endif @else

Aucun événement à venir pour le moment

Revenez bientôt pour découvrir nos prochaines activités

@endif

Médiathèque

@if($church->media->count() > 0)
@foreach($church->media->take(4) as $media)
@php $icon = $media->media_type === 'video' ? 'video' : ($media->media_type === 'audio' ? 'headphones' : 'image'); $color = $media->media_type === 'video' ? 'red' : ($media->media_type === 'audio' ? 'purple' : 'green'); @endphp
@if($media->media_type === 'image' && $media->file_path) {{ $media->title }} @elseif($media->media_type === 'video' && $media->thumbnail) {{ $media->title }}
@elseif($media->media_type === 'video' && $media->youtube_id) {{ $media->title }}
@else
@endif

{{ $media->title }}

{{ $media->media_type === 'video' ? 'Vidéo' : ($media->media_type === 'image' ? 'Image' : 'Audio') }}
@endforeach
@if($church->media->count() > 4) @endif @else

Aucun média disponible pour le moment

Des vidéos et audios seront bientôt ajoutés

@endif

Témoignages

@if($church->testimonials->where('status', 'approved')->count() > 0)
@foreach($church->testimonials->where('status', 'approved')->take(3) as $testimonial)
@if($testimonial->title)

{{ $testimonial->title }}

@endif

"{{ Str::limit($testimonial->content, 200) }}"

{{ $testimonial->author_name }}
@endforeach
@if($church->testimonials->where('status', 'approved')->count() > 3) @endif @else

Aucun témoignage disponible pour le moment

Soyez le premier à partager votre témoignage

@endif

Informations de contact

@if($church->address)

Adresse

{{ $church->address }}

{{ $church->city }}, {{ $church->country }}

@endif @if($church->phone) @endif @if($church->email) @endif @if($church->pastor)

Responsable

{{ $church->pastor }}

@endif
@if($church->phone) Appeler @endif @if($church->email) Envoyer un email @endif

Statistiques

Événements
{{ $church->events->count() }}
Médias
{{ $church->media->count() }}
Témoignages
{{ $church->testimonials->where('status', 'approved')->count() }}

Rejoignez notre famille

Vous êtes les bienvenus pour participer à nos cultes et activités

@if($churchDonations->count() > 0)

Soutenir Cette Église

Participez aux projets et besoins spécifiques de l'église {{ $church->name }}

@foreach($churchDonations as $donation)

{{ $donation->title }}

@if($donation->description)

{{ $donation->description }}

@endif {{ $donation->button_text }}
@endforeach
@endif @endsection @push('scripts') @endpush