@extends('shared.trip-planner', ['title' => 'Merkezi Gezi Noktaları']) @section('content')

Merkezi Gezi Noktaları

Gezi noktalarını, bölge ve kategori bağlantılarını, kart fotoğraflarını ve yayın durumunu tek listeden yönetin.

@if(session('success'))
{{ session('success') }}
@endif @if(session('warning'))
{{ session('warning') }}
@endif
{{ $places->total() }} gezi noktası @if($places->total() > 0) {{ $places->getCollection()->sum(fn($row) => count((array)($row->manual_photo_paths ?? []))) }} fotoğraf / bu sayfa @endif
@if($places->isEmpty())
{{ $searchTerm !== '' ? 'Aramanızla eşleşen gezi noktası bulunamadı.' : ($selectedRegionId || $selectedCategoryId ? 'Seçilen bölge ve kategoriye uygun gezi noktası bulunamadı.' : 'Henüz merkezi gezi noktası bulunmuyor.') }}
@else
@foreach($places as $row) @php $displayName = trim((string)($row->name ?: $row->google_name ?: ('Gezi Noktası #'.$row->id))); $photoPaths = collect($row->manual_photo_paths ?? [])->map(fn($path)=>trim((string)$path))->filter()->unique()->values(); $coverPath = trim((string)($row->manual_cover_photo_path ?? '')); if($coverPath === '' || !$photoPaths->contains($coverPath)) $coverPath = (string)($photoPaths->first() ?? ''); $coverUrl = $coverPath !== '' ? asset($coverPath) : ''; $categoryLabels = $row->categories->pluck('label')->filter()->values(); if($categoryLabels->isEmpty() && $row->category?->label) $categoryLabels = collect([$row->category->label]); $categoryText = $categoryLabels->isNotEmpty() ? $categoryLabels->join(', ') : 'Kategori yok'; $regionText = $row->region?->label ?: 'Bölge yok'; $globalIndex = ((int) $orderPositions->get((int) $row->id, 0)) + 1; $canUp = $globalIndex > 1; $canDown = $globalIndex < $orderPositions->count(); $mapUrl = trim((string)($row->google_source_url ?? '')); @endphp
@if($coverUrl) {{ $displayName }} @else Fotoğraf
yok @endif
{{ $displayName }}
{{ $regionText }} · {{ $categoryText }}
Sıra {{ (int)$row->sort_order }} {{ $photoPaths->count() }} fotoğraf
{{ $row->is_active ? 'Aktif' : 'Pasif' }}
@endforeach
@if($places->hasPages()) @php $tppCurrentPage = $places->currentPage(); $tppLastPage = $places->lastPage(); $tppPageStart = max(1, $tppCurrentPage - 2); $tppPageEnd = min($tppLastPage, $tppCurrentPage + 2); @endphp @endif
Gösterilen: {{ $places->firstItem() }}–{{ $places->lastItem() }} / {{ $places->total() }} · En son eklenenler önce
@endif
@if($places->isNotEmpty())
@endif @endsection