{{-- resources/views/mediatheque.blade.php --}} @extends('layouts.base') @section('title', 'Médiathèque - Conseil d\'État de Côte d\'Ivoire') @section('content') {{-- Header de la Page --}}
{{-- Onglets --}}
{{-- PANNEAU PHOTOS --}}
@if(isset($photos) && $photos->count() > 0)
@foreach($photos as $album) @php $galleryId = 'album-' . $album->id; $coverRaw = $album->image_path ?? ''; $coverUrl = str_starts_with($coverRaw, 'http') ? $coverRaw : asset('storage/' . ltrim(str_replace('storage/', '', $coverRaw), '/')); $imagesEnfants = $album->fichiers ? $album->fichiers->where('chemin', '!=', '#')->where('chemin', '!=', $coverUrl) : collect(); $totalPhotos = $imagesEnfants->count() + 1; @endphp
{{ $album->titre }}
{{ $totalPhotos }}
@if($imagesEnfants->count() > 0) @foreach($imagesEnfants as $fichierRestant) @endforeach @endif
{{ $album->created_at ? $album->created_at->translatedFormat('d M Y') : 'Date non définie' }}

{{ Str::limit($album->titre, 40) }}

@if(!empty($album->evenement))
{{ Str::limit($album->evenement, 50) }}
@endif
@endforeach
@else

Aucun album disponible

Les collections photographiques apparaîtront ici prochainement.

@endif
{{-- PANNEAU VIDÉOS --}}
@if(isset($videos) && $videos->count() > 0)
@foreach($videos as $video) @php $coverRaw = $video->image_url ?? ''; $coverVideoUrl = str_starts_with($coverRaw, 'http') ? $coverRaw : asset('storage/' . ltrim(str_replace('storage/', '', $coverRaw), '/')); $firstFile = $video->fichiers?->first(); $videoSrc = $firstFile ? $firstFile->chemin : '#'; @endphp
{{ $video->titre }} @if($videoSrc !== '#')
@endif
{{ $video->created_at ? $video->created_at->translatedFormat('d M Y') : 'Date non définie' }}

{{ Str::limit($video->titre, 40) }}

@if(!empty($video->evenement))
{{ Str::limit($video->evenement, 50) }}
@endif
@endforeach
@else

Aucune vidéo disponible

Les productions vidéos apparaîtront ici prochainement.

@endif
@endsection @push('scripts') {{-- ══════════════════════════════════════════════════════════════════ SCRIPTS ══════════════════════════════════════════════════════════════════ --}} @endpush