{{-- Quick-view "Program" sekmesi — TABLO + LEDGER (defter) tasarımı. Liste tek satırlık tablo satırlarıdır: tek ekranda azami başlık görünür. Satıra tıklayınca altında müşteri Künyesiyle AYNI defter paneli açılır (components/quick-view/ledger-ui): her alan tek satır, tıkla → yerinde düzenle, blur/Enter → itinerary.update-field'e PATCH. Günübirlik, kültür ve yurtdışı turlarında ortak kullanılır; tip farkları: günübirlikte saat/süre/aktivite tipi + sıra ('day'), çok günlü turlarda gün numarası ('cultural' — kültür ve yurtdışı aynı alan kümesini kullanır). Gerekli: $tour, $editBase Opsiyonel: $itMode ('day'|'cultural'), $items --}} @php $itMode = $itMode ?? 'day'; $isDayIt = $itMode === 'day'; $items = $items ?? $tour->activeItineraries; $storeUrl = route("$editBase.itinerary.store", $tour); $actTypes = \App\Support\ItineraryActivity::LABELS; $actOptions = \App\Support\ItineraryActivity::options(); /** Tek satır tanımı — ledger-row ile aynı sözleşme. */ $itRow = 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, ]; }; /** HTML açıklamadan tek satırlık özet metin. */ $itPlain = fn ($html) => trim(preg_replace('/\s+/u', ' ', html_entity_decode(strip_tags((string) $html), ENT_QUOTES, 'UTF-8'))); $itCount = $items->count(); $itMinutes = $isDayIt ? (int) $items->sum('duration_minutes') : 0; $itDays = $isDayIt ? 0 : $items->pluck('day_number')->filter()->unique()->count(); $itNextDay = $isDayIt ? null : (int) ($items->max('day_number') ?? 0) + 1; $itCols = $isDayIt ? 6 : 4; @endphp
{{-- ══ ÜST ÇUBUK ══ --}}
Tur Programı {{ $itCount }} başlık @if($isDayIt && $itMinutes > 0) {{ intdiv($itMinutes, 60) }} sa {{ $itMinutes % 60 }} dk toplam @elseif(!$isDayIt && $itDays > 0) {{ $itDays }} gün @endif @if($itCount > 1) @endif
{{-- ══ YENİ BAŞLIK ══ --}}
Yeni Program Başlığı
@if($isDayIt) @else @endif
Açıklamayı ekledikten sonra satırı açıp yazabilirsiniz.
{{-- ══ PROGRAM TABLOSU ══ --}} @if($itCount)
@if($isDayIt) @endif @if($isDayIt)@endif @foreach($items as $it) @php $fieldUrl = route("$editBase.itinerary.update-field", [$tour, $it]); $itTime = $isDayIt ? substr((string) ($it->time ?? ''), 0, 5) : ''; $snip = $itPlain($it->description); $rows = $isDayIt ? [ $itRow('Başlık', 'title', $it->title, null, ['ph' => 'Program başlığı']), $itRow('Saat', 'time', $itTime, $itTime, ['type' => 'time', 'mono' => true]), $itRow('Süre (dk)', 'duration_minutes', $it->duration_minutes, $it->duration_minutes ? $it->duration_minutes . ' dk' : '', ['type' => 'number', 'mono' => true]), $itRow('Konum', 'location', $it->location, null, ['ph' => 'Buluşma / gezi noktası']), $itRow('Aktivite Tipi', 'activity_type', $it->activity_type, $actTypes[$it->activity_type] ?? '', ['type' => 'select', 'options' => $actOptions]), $itRow('Sıra', 'sort_order', $it->sort_order, null, ['type' => 'number', 'mono' => true]), ] : [ $itRow('Gün No', 'day_number', $it->day_number, null, ['type' => 'number', 'mono' => true]), $itRow('Başlık', 'title', $it->title, null, ['ph' => 'Gün başlığı']), $itRow('Konum', 'location', $it->location, null, ['ph' => 'Şehir / bölge']), ]; @endphp @if($isDayIt) @endif @endforeach
{{ $isDayIt ? 'Saat' : 'Gün' }} Başlık KonumSüreTip
@if($isDayIt) {{ $itTime ?: '—' }} @else GÜN{{ $it->day_number }} @endif {{ $it->title }} {{ $snip }} @if($it->location)@endif{{ $it->location ?: '—' }} {{ $it->duration_minutes ? $it->duration_minutes . ' dk' : '—' }} {{ $actTypes[$it->activity_type] ?? '—' }}
{{ $isDayIt ? ($itTime ?: 'Saatsiz başlık') : 'Gün ' . $it->day_number }}
@foreach($rows as $r) @include('components.quick-view.ledger-row', ['r' => $r]) @endforeach
@include('agency.products._qv-quill-inline', [ 'name' => 'description', 'label' => 'Açıklama', 'value' => $it->description, 'uf' => $fieldUrl, 'defs' => $attractions ?? null, 'defsMode' => 'item', 'defsLabel' => 'Gezilecek yer ekle', 'defsIcon' => 'fa-map-location-dot', ])
Satıra tıklayın, alanı tıklayıp yazın — değişiklik anında kaydedilir.
@else
Henüz program başlığı yok {{ $isDayIt ? 'Turun gün içindeki akışını saat saat ekleyin.' : 'Turun gün gün akışını ekleyin.' }}
@endif
{{-- Ortak ledger stil + davranış (bir kez bağlanır) --}} @include('components.quick-view.ledger-ui') @once @endonce