{{-- Quick-view "Genel Bilgiler" — LEDGER (defter) tasarımı. Müşteri kartındaki Künye paneliyle AYNI kalıp (components/quick-view/ledger-ui): her alan tek satır, tıkla → yerinde düzenle, blur/Enter → update-field'e PATCH, boş alanlar soluk placeholder ile varsayılan görünür. Günübirlik VE kültür/yurtdışı turlarında kullanılır; tip farkları: günübirlikte saat alanları + her zaman görünen Kalkış Noktaları, kültür/yurtdışında Gün/Gece alanları + Ulaşım kartı (uçak/karayolu). Zengin bloklar (Quill içerik, kalkış noktaları, kategoriler) satır değil, aynı kart dilinde .pfx-body gövdeleri olarak çizilir — kayıt mantıkları değişmedi (_qv-inline-blocks / _qv-richtext bağları aynen çalışır). Gerekli: $tour, $editBase, $cities, $categories, $productType ('day'|'cultural'|'international'). Opsiyonel: $uf --}} @php $productType = $productType ?? 'day'; $isDay = $productType === 'day'; $categories = $categories ?? collect(); $selectedCatIds = $tour->categories->pluck('id')->toArray(); $uf = $uf ?? route("$editBase.update-field", $tour); $transferUrl = route("$editBase.transfer-points", $tour); $catUrl = route("$editBase.categories", $tour); $cityOptions = collect($cities) ->map(fn ($c) => ['value' => (string) $c->id, 'label' => $c->city ?? $c->name]) ->prepend(['value' => '', 'label' => '—'])->values()->all(); $tourTypeOptions = [['value' => 'domestic', 'label' => 'Yurt İçi'], ['value' => 'international', 'label' => 'Yurt Dışı']]; $difficultyOptions = [['value' => '', 'label' => '—'], ['value' => 'easy', 'label' => 'Kolay'], ['value' => 'moderate', 'label' => 'Orta'], ['value' => 'challenging', 'label' => 'Zor'], ['value' => 'extreme', 'label' => 'Çok Zor']]; // Ulaşım (kültür/yurtdışı): şekle göre uçuş bilgileri ya da kalkış noktaları açılır $transportOptions = [['value' => '', 'label' => '—'], ['value' => 'air', 'label' => 'Uçak'], ['value' => 'road', 'label' => 'Karayolu'], ['value' => 'train', 'label' => 'Tren'], ['value' => 'ferry', 'label' => 'Feribot'], ['value' => 'other', 'label' => 'Diğer']]; $flightTime = $tour->flight_departure_time ? \Carbon\Carbon::parse($tour->flight_departure_time)->format('H:i') : ''; /** Seçim listesinde değerin etiketini bulur ("—" değer sayılmaz). */ $optLabel = function (array $opts, $value) { foreach ($opts as $o) { if ((string) $o['value'] === (string) $value) return $o['label'] === '—' ? '' : $o['label']; } return (string) ($value ?? ''); }; /** Tek satır tanımı — müşteri Künyesindeki $row ile aynı sözleşme. */ $row = function (string $label, ?string $field, $value, ?string $text = null, array $o = []) { return [ 'label' => $label, 'field' => $field, 'type' => $o['type'] ?? 'text', 'value' => $value === null ? '' : (string) $value, 'text' => $text === null ? ($value === null ? '' : (string) $value) : $text, 'options' => $o['options'] ?? null, 'mono' => $o['mono'] ?? false, 'ph' => $o['ph'] ?? null, ]; }; $startTime = $tour->start_time ? substr((string) $tour->start_time, 0, 5) : ''; $endTime = $tour->end_time ? substr((string) $tour->end_time, 0, 5) : ''; // Temel Bilgiler: günübirlikte saatler, çok günlü turlarda Gün/Gece $basicRows = [ $row('Tur Adı', 'name', $tour->name, null, ['ph' => 'Tur adı']), $row('Tur Tipi', 'tour_type', $tour->tour_type, $optLabel($tourTypeOptions, $tour->tour_type), ['type' => 'select', 'options' => $tourTypeOptions]), ]; if ($isDay) { $basicRows[] = $row('Başlangıç Saati', 'start_time', $startTime, $startTime, ['type' => 'time', 'mono' => true]); $basicRows[] = $row('Bitiş Saati', 'end_time', $endTime, $endTime, ['type' => 'time', 'mono' => true]); } else { $basicRows[] = $row('Gün', 'days', $tour->days, null, ['type' => 'number', 'mono' => true]); $basicRows[] = $row('Gece', 'nights', $tour->nights, null, ['type' => 'number', 'mono' => true]); } $basicRows[] = $row('Kısa Açıklama', 'short_description', $tour->short_description, null, ['type' => 'textarea', 'ph' => 'Listelerde görünen 1-2 cümlelik tanıtım']); $sections = [ ['title' => 'Temel Bilgiler', 'icon' => 'fa-circle-info', 'rows' => $basicRows], ['title' => 'Konum Bilgileri', 'icon' => 'fa-map-marker-alt', 'rows' => [ $row('Kalkış Şehri', 'departure_city_id', (string) $tour->departure_city_id, $optLabel($cityOptions, $tour->departure_city_id), ['type' => 'select', 'options' => $cityOptions]), $row('Varış Şehri', 'arrival_city_id', (string) $tour->arrival_city_id, $optLabel($cityOptions, $tour->arrival_city_id), ['type' => 'select', 'options' => $cityOptions]), ]], ['title' => 'Kapasite ve Yaş Sınırları', 'icon' => 'fa-users', 'rows' => [ $row('Min. Katılımcı', 'min_participants', $tour->min_participants, null, ['type' => 'number', 'mono' => true]), $row('Maks. Katılımcı', 'max_participants', $tour->max_participants, null, ['type' => 'number', 'mono' => true]), $row('Min. Yaş', 'min_age', $tour->min_age, null, ['type' => 'number', 'mono' => true]), $row('Maks. Yaş', 'max_age', $tour->max_age, null, ['type' => 'number', 'mono' => true]), $row('Zorluk Seviyesi', 'difficulty_level', $tour->difficulty_level, $optLabel($difficultyOptions, $tour->difficulty_level), ['type' => 'select', 'options' => $difficultyOptions]), $row('Zorluk Açıklaması', 'difficulty_description', $tour->difficulty_description, null, ['type' => 'textarea', 'ph' => 'Zorluk hakkında not']), ]], ]; // Boş alan sayacı ortak ledger-card partial'ında hesaplanır. @endphp {{-- dp-* (kalkış noktaları) ve qcat-* (kategoriler) widget stilleri — kayıt mantığı _qv-inline-blocks'ta; burada yalnızca görünüm. --}} {{-- .qv-gform: _qv-general-ui'nin göster/gizle mantığı bu class'a dayanır (form DEĞİL) --}}
{{-- ── Genel Bilgiler: ledger kartı (ortak üretici) ── --}} @include('components.quick-view.ledger-card', ['card' => [ 'title' => 'Genel Bilgiler', 'icon' => 'fa-circle-info', 'url' => $uf, 'sections' => $sections, ]]) {{-- ── İçerik (Quill inline — blur'da otomatik kayıt) ── --}}
İçerik
{{-- Her alan KENDİ tanım tipini gösterir; 'defs' geçilmeyen alanda seçici çıkmaz (bkz. _qv-quill-inline'daki miras uyarısı). --}} @include('agency.products._qv-quill-inline', ['name' => 'description', 'label' => 'Detaylı Açıklama', 'value' => $tour->description, 'uf' => $uf, 'defs' => null]) @include('agency.products._qv-quill-inline', ['name' => 'places_to_visit', 'label' => 'Gezilecek Yerler', 'value' => $tour->places_to_visit, 'uf' => $uf, 'defs' => $attractions ?? null, 'defsMode' => 'item', 'defsLabel' => 'Gezilecek yer ekle', 'defsIcon' => 'fa-map-location-dot'])
@include('agency.products._qv-quill-inline', ['name' => 'inclusions', 'label' => 'Fiyata Dahil', 'value' => $tour->inclusions, 'uf' => $uf, 'defs' => $inclusionsTemplates ?? null, 'defsMode' => 'block', 'defsLabel' => 'Hazır tanım ekle', 'defsIcon' => 'fa-circle-check'])
@include('agency.products._qv-quill-inline', ['name' => 'exclusions', 'label' => 'Fiyata Dahil Değil', 'value' => $tour->exclusions, 'uf' => $uf, 'defs' => $exclusionsTemplates ?? null, 'defsMode' => 'block', 'defsLabel' => 'Hazır tanım ekle', 'defsIcon' => 'fa-circle-xmark'])
@if($isDay) {{-- ── Kalkış Noktaları (günübirlik: her zaman görünür) ── --}}
Kalkış Noktaları
@include('agency.products._qv-departure-points')
@else {{-- ── Ulaşım (kültür/yurtdışı): şekle göre uçuş bilgileri ya da kalkış noktaları ── --}} @php $isAir = $tour->transportation_method === 'air'; $isRoad = in_array($tour->transportation_method, ['road', 'train', 'ferry', 'other']); $airRows = [ $row('Kalkış Havalimanı', 'departure_airports', $tour->departure_airports), $row('Varış Havalimanı', 'arrival_airports', $tour->arrival_airports), $row('Uçuş Numarası', 'departure_flight_number', $tour->departure_flight_number, null, ['mono' => true]), $row('Uçuş Kalkış Saati', 'flight_departure_time', $flightTime, $flightTime, ['type' => 'time', 'mono' => true]), ]; @endphp
Ulaşım
@include('components.quick-view.ledger-row', ['r' => $row('Ulaşım Şekli', 'transportation_method', $tour->transportation_method, $optLabel($transportOptions, $tour->transportation_method), ['type' => 'select', 'options' => $transportOptions, 'ph' => 'Ulaşım şekli seçin'])])
{{-- Uçak seçiliyse: uçuş bilgisi satırları --}}
Uçuş Bilgileri
@foreach($airRows as $r) @include('components.quick-view.ledger-row', ['r' => $r]) @endforeach
{{-- Karayolu/tren/feribot/diğer seçiliyse: kalkış noktaları --}}
@include('agency.products._qv-departure-points')
@include('components.quick-view.ledger-row', ['r' => $row('Ulaşım Notları', 'transportation_notes', $tour->transportation_notes, null, ['type' => 'textarea', 'ph' => 'Ulaşımla ilgili not'])])
@endif {{-- ── Politikalar ── --}}
Politikalar
@include('agency.products._qv-hours-unit-field', ['field' => 'cancellation_deadline_hours', 'label' => 'Ücretsiz İptal (kalkıştan önce)', 'hours' => $tour->cancellation_deadline_hours, 'uf' => $uf])
@include('agency.products._qv-quill-inline', ['name' => 'cancellation_policy', 'label' => 'İptal Politikası', 'value' => $tour->cancellation_policy, 'uf' => $uf, 'defs' => $cancellationPolicies ?? null, 'defsMode' => 'block', 'defsLabel' => 'Hazır iptal koşulu', 'defsIcon' => 'fa-ban']) @include('agency.products._qv-quill-inline', ['name' => 'terms_conditions', 'label' => 'Şartlar & Koşullar', 'value' => $tour->terms_conditions, 'uf' => $uf, 'defs' => $termsConditions ?? null, 'defsMode' => 'block', 'defsLabel' => 'Hazır şart metni', 'defsIcon' => 'fa-file-contract'])
{{-- ── Kategoriler ── --}} @php $ptSlug = ['cultural' => 'kultur-turu', 'international' => 'yurtdisi-turu', 'day' => 'gunubirlik-tur'][$productType] ?? 'gunubirlik-tur'; $ptId = \App\Models\Product\ProductType::where('slug', $ptSlug)->value('id'); @endphp
Kategoriler
{{-- Seçilebilir chip bulutu: tıkla → seç/kaldır, otomatik kaydedilir --}}
@foreach($categories as $cat) @endforeach
@if(!$categories->count())

Tanımlı kategori yok. Aşağıdan hızlıca ekleyebilirsiniz.

@endif {{-- Hızlı kategori ekle: yazıp Enter/Ekle → oluşturulur, seçili gelir ve tura kaydedilir --}}
{{-- Ortak ledger stil + davranış (bir kez bağlanır) --}} @include('components.quick-view.ledger-ui') @unless($isDay) @endunless