@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'))
check_circle {{ session('success') }}
@endif
@if(session('warning'))
warning {{ session('warning') }}
@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)
@else
Fotoğraf yok
@endif
{{ $displayName }}
map {{ $regionText }} · {{ $categoryText }}
swap_vert Sıra {{ (int)$row->sort_order }}
photo_library {{ $photoPaths->count() }} fotoğraf
{{ $row->is_active ? 'Aktif' : 'Pasif' }}
more_vert
@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())