@php $primaryPrice = $tour->getPrimaryPriceInfo(); // en yakın tarihin ana pazar fiyatı $statusLabel = $tour->is_draft ? 'Taslak' : ($tour->is_active ? ($tour->is_public ? 'Yayında' : 'Gizli') : 'Pasif'); $statusClass = $tour->is_draft ? 'pqv-b-amber' : ($tour->is_active ? ($tour->is_public ? 'pqv-b-green' : 'pqv-b-slate') : 'pqv-b-red'); $marketplaces = $tour->product?->marketplaces ?? collect(); $editBase = 'agency.products.kultur-turlari'; $uf = route("$editBase.update-field", $tour); $cityOptions = collect($cities)->map(fn($c) => ['value' => (string) $c->id, 'label' => $c->city ?? $c->name])->values(); $boolOptions = [['value' => '1', 'label' => 'Evet'], ['value' => '0', 'label' => 'Hayır']]; $tourTypeOptions = [['value' => 'domestic', 'label' => 'Yurt İçi'], ['value' => 'international', 'label' => 'Yurt Dışı']]; $difficultyOptions = [['value' => 'easy', 'label' => 'Kolay'], ['value' => 'moderate', 'label' => 'Orta'], ['value' => 'challenging', 'label' => 'Zor'], ['value' => 'extreme', 'label' => 'Çok Zor']]; @endphp {{-- slim: minimal header — avatar yok, başlık + rozetler tek şeritte (hedef sabit tasarım) --}} {{-- Header'da avatar yok (slim); yığın tutamağı ikonu buradan okur --}} {{ $statusLabel }} {{ $tour->code ?? '—' }} {{ $tour->tour_type_display_name ?? '' }} @if($tour->departureCity) {{ $tour->departureCity?->city ?? $tour->departureCity?->name }} @endif
SÜRE {{ $tour->days }}G / {{ $tour->nights }}Gc
ANA FİYAT{{ $primaryPrice && $primaryPrice['start_date'] ? ' · ' . $primaryPrice['start_date']->translatedFormat('d M') : '' }} {{ $primaryPrice ? number_format($primaryPrice['price'], 0, ',', '.') . ' ' . $primaryPrice['currency'] : '—' }}
YAKLAŞAN TARİH {{ $tour->upcomingDates->count() }}
@if($tour->is_draft) @endif
{{-- ── GENEL ── --}}
{{-- Ana pazar seçilmemişse en üstte uyar (satış kartı buraya yönlendiriyor) --}} @include('agency.products._qv-primary-market-alert', ['tour' => $tour, 'marketplaces' => $marketplaces, 'syncUrl' => route("$editBase.sync-marketplaces", $tour)]) {{-- Müşteri kartındaki Künye ile aynı ledger tasarımı (sabit QV tasarımı) --}} @include('agency.products._qv-general-ledger', [ 'tour' => $tour, 'editBase' => $editBase, 'cities' => $cities, 'categories' => $categories, 'uf' => $uf, 'productType' => 'cultural', ])
{{-- ── PROGRAM ── --}}
{{-- Tablo + defter (ledger) tasarımı — sabit QV alan tasarımı --}} @include('agency.products._qv-itinerary', [ 'tour' => $tour, 'editBase' => $editBase, 'itMode' => 'cultural', 'items' => $tour->activeItineraries, ])
{{-- ── TARİHLER & FİYATLAR ── --}} @include('agency.products._qv-dates-tab') {{-- ── GÖRSELLER ── --}}
@include('agency.products._qv-media', [ 'tour' => $tour, 'images' => $tour->activeTourImages, 'uploadUrl' => route("$editBase.media.upload-images", $tour), 'deleteRoute' => "$editBase.media.delete-image", 'coverRoute' => "$editBase.media.set-cover", 'featuredRoute' => "$editBase.media.toggle-featured", ])
{{-- ── SEO ── --}}
{{-- Ledger (defter) tasarımı — sabit QV alan tasarımı --}} @include('agency.products._qv-seo-ledger', ['tour' => $tour, 'editBase' => $editBase, 'uf' => $uf])
{{-- ── AYARLAR ── --}}
{{-- "Ayarları düzenle" linki kaldırıldı: tüm ayarlar bu sekmeden yönetiliyor. --}} @php // Evet/Hayır satırı üretici (bool alanlar hiç "boş" olmaz) $qsBool = fn (string $label, string $field, $v) => [ 'label' => $label, 'field' => $field, 'type' => 'select', 'options' => $boolOptions, 'value' => $v ? '1' : '0', 'text' => $v ? 'Evet' : 'Hayır', ]; $qsNum = fn (string $label, string $field, $v, ?string $ph = null) => [ 'label' => $label, 'field' => $field, 'type' => 'number', 'mono' => true, 'value' => $v, 'text' => $v === null ? '' : (string) $v, 'ph' => $ph, ]; $qsDT = fn ($v) => $v ? \Carbon\Carbon::parse($v) : null; $qsPub = $qsDT($tour->published_at); $qsExp = $qsDT($tour->expires_at); @endphp
{{-- Pazaryerleri en üstte: en sık kullanılan ayar --}} @include('agency.products._qv-marketplaces-ledger', ['allMarketplaces' => $allMarketplaces, 'selectedIds' => $marketplaces->pluck('id'), 'syncUrl' => route("$editBase.sync-marketplaces", $tour)]) {{-- Durum, rezervasyon ve sayısal ayarlar: ledger kartı --}} @include('components.quick-view.ledger-card', ['card' => [ 'title' => 'Ayarlar', 'icon' => 'fa-cog', 'url' => $uf, 'class' => 'pfx-lw', 'note' => 'Son Rezervasyon: kalkıştan kaç saat önce rezervasyonun kapanacağı. Otomatik Kesin Kalkış: minimum katılımcı sayısına ulaşınca kalkış kendiliğinden kesinleşir.', 'sections' => [ ['title' => 'Durum & Görünürlük', 'icon' => 'fa-toggle-on', 'rows' => [ $qsBool('Aktif', 'is_active', $tour->is_active), $qsBool('Yayında', 'is_public', $tour->is_public), $qsBool('Rezervasyona Açık', 'is_bookable', $tour->is_bookable), $qsBool('Öne Çıkan', 'is_featured', $tour->is_featured), $qsBool('Çok Satan', 'is_bestseller', $tour->is_bestseller), $qsBool('Yeni', 'is_new', $tour->is_new), $qsBool('Anında Rezervasyon', 'instant_booking', $tour->instant_booking), $qsBool('İade Edilebilir', 'refundable', $tour->refundable), $qsBool('Çocuk Dostu', 'child_friendly', $tour->child_friendly), $qsBool('Bebek Kabul', 'infant_allowed', $tour->infant_allowed), ]], ['title' => 'Rezervasyon & Kesin Kalkış', 'icon' => 'fa-shield-alt', 'rows' => [ $qsBool('Otomatik Kesin Kalkış', 'auto_guarantee_on_min', $tour->auto_guarantee_on_min), ]], ['title' => 'Sayısal Ayarlar', 'icon' => 'fa-sliders', 'rows' => [ $qsNum('Öncelik', 'priority', $tour->priority ?? 0), $qsNum('Son Rezervasyon (saat)', 'booking_deadline_hours', $tour->booking_deadline_hours), ['label' => 'Yayın Tarihi', 'field' => 'published_at', 'type' => 'datetime-local', 'mono' => true, 'value' => $qsPub?->format('Y-m-d\TH:i'), 'text' => $qsPub?->format('d.m.Y H:i')], ['label' => 'Son Geçerlilik', 'field' => 'expires_at', 'type' => 'datetime-local', 'mono' => true, 'value' => $qsExp?->format('Y-m-d\TH:i'), 'text' => $qsExp?->format('d.m.Y H:i')], ]], ], ]]) {{-- Yaş aralıkları: yeni tarih eklerken forma otomatik çekilir --}} @include('components.quick-view.ledger-card', ['card' => [ 'title' => 'Yaş Aralıkları', 'icon' => 'fa-children', 'url' => $uf, 'class' => 'pfx-lw', 'note' => $tour->infant_allowed ? 'Buradaki yaşlar yeni tarih eklerken otomatik çekilir; tarih formundaki "Yaş Aralıkları" bölümünden o tarihe özel değiştirilebilir.' : 'Bu tur bebek kabul etmiyor; bebek yaş alanları gizlendi. Yukarıdaki "Bebek Kabul" seçeneğinden açabilirsiniz.', 'sections' => [ ['title' => 'Fiyat Yaşları', 'icon' => 'fa-child-reaching', 'rows' => array_values(array_filter([ $qsNum('Çocuk Min Yaş', 'child_min_age', $tour->child_min_age, '2'), $qsNum('Çocuk Max Yaş', 'child_max_age', $tour->child_max_age, '12'), $tour->infant_allowed ? $qsNum('Bebek Min Yaş', 'infant_min_age', $tour->infant_min_age, '0') : null, $tour->infant_allowed ? $qsNum('Bebek Max Yaş', 'infant_max_age', $tour->infant_max_age, '2') : null, ]))], ['title' => 'Katılım Sınırı', 'icon' => 'fa-user-check', 'rows' => [ $qsNum('Tura Katılım Min Yaş', 'min_age', $tour->min_age), $qsNum('Tura Katılım Max Yaş', 'max_age', $tour->max_age), ]], ], ]]) {{-- İptal son süresi: saat/gün birimli özel alan (değer daima saat kaydedilir) --}}
İptal Son Süresi
@include('agency.products._qv-hours-unit-field', ['field' => 'cancellation_deadline_hours', 'label' => 'Ücretsiz İptal (kalkıştan önce)', 'hours' => $tour->cancellation_deadline_hours, 'uf' => $uf])
Rezervasyonun ücretsiz iptal edilebileceği son süre; birim gün seçilse de saat olarak kaydedilir.
{{-- Kademeli Ödeme: ledger satırları + aşama repeater'ı aynı kartta --}}
Kademeli Ödeme Planı
@foreach([ $qsBool('Kademeli Ödeme Aktif', 'payment_plan_enabled', $tour->payment_plan_enabled), $qsBool('Web Satışında Kullan', 'online_payment_enabled', $tour->online_payment_enabled), $qsNum("Web'de İlk Alınacak (%)", 'online_deposit_percent', $tour->online_deposit_percent), ] as $r) @include('components.quick-view.ledger-row', ['r' => $r]) @endforeach
Ödemeler, aşamaları eklediğiniz sıraya göre (1, 2, 3…) tahsil edilir. Numaralar ödeme sırasını gösterir.
@foreach(($tour->payment_plan ?? []) as $st)
@endforeach
{{-- /pfx-body --}}
{{-- /pfx (kademeli ödeme) --}}
{{-- /qv-left-stack --}} @include('agency.products._qv-pricing-classes', ['pricingClasses' => $pricingClasses, 'saveUrl' => route("$editBase.pricing-classes", $tour)])
{{-- ── ÇEVİRİLER ── --}}
{{-- Ledger (defter) kart sarmalı — sabit QV tasarımı --}} @include('agency.products._qv-translations-ledger', ['tour' => $tour, 'marketplaces' => $marketplaces, 'fetchUrl' => route("$editBase.translations.fetch", $tour), 'saveUrl' => route("$editBase.translations.save", $tour)])
@include('agency.products._quick-view-styles') @include('agency.products._qv-dates-ui') @include('agency.products._qv-marketplace-prices-ui') @include('agency.products._qv-pricing-classes-ui') @include('agency.products._qv-general-ui') @include('agency.products._qv-richtext') @include('agency.products._qv-inline-blocks') @include('agency.products._qv-seo-ui') @include('agency.products._quick-view-crud-script')