@extends('layouts.dashboard') @section('content') @php /** * Vendor → TV Screens → editor. Compose a board from 1–4 columns (each a menu category, an image, * a video/YouTube, or featured products) with a live preview, board settings, and TV pairing. * Built on the dashboard's own components (qm-card / qm-form-grid / qm-switch-row / form-select). * @var array|null $screen @var array $config @var array $devices @var array $creatives * @var array $categories @var array $items @var array $restaurant */ $screen = $screen ?? null; $config = $config ?? \App\Models\TvScreen::defaultConfig(); $devices = $devices ?? []; // Dayparting is a property of the SCREEN ROW, not of the board config, so it is offered only where a // row exists to carry it — the vendor editor. The admin authoring a platform template gets no list. $schedules = $schedules ?? []; $scheduleId = (int) ($screen['schedule_id'] ?? 0); $sid = $screen ? (int) $screen['id'] : 0; $slug = (string) ($restaurant['slug'] ?? ''); $playUrl = rtrim((string) route('tv.play'), '/'); // Template mode: the admin authors a platform board template with this same editor. Values default to // the vendor's own screen flow, so a normal vendor edit is unchanged. $tplMode = $tplMode ?? false; $tplType = $tplType ?? 'tv_screen'; $tplId = (int) ($tplId ?? 0); $formAction = $formAction ?? route('vendor.screens'); $backUrl = $backUrl ?? route('vendor.screens'); $jsData = [ 'slug' => $slug, // The editor needs to know it is authoring a TEMPLATE: a template cannot keep a specific dish, // so it must not offer one. See the product overlay in tv-editor.js. 'tplMode' => (bool) $tplMode, 'previewUrl' => route('tv.preview'), 'board' => [ 'orientation' => $config['orientation'], 'theme' => $config['theme'], 'accent' => $config['accent'], 'bgColor' => $config['bgColor'], 'header' => (bool) $config['header'], 'headerText' => $config['headerText'], 'showCuisine' => (bool) $config['showCuisine'], 'footer' => (bool) $config['footer'], 'footerText' => $config['footerText'], 'poweredBy' => (bool) $config['poweredBy'], 'spacing' => $config['spacing'], ], 'themeBg' => \App\Models\TvScreen::THEME_BG, 'columns' => array_values($config['columns'] ?? []), 'categories' => array_map(static fn ($c) => ['id' => (int) $c['id'], 'name' => $c['name']], $categories ?? []), 'items' => array_map(static fn ($i) => ['id' => (int) $i['id'], 'name' => $i['name'], 'cat' => (int) $i['menu_category_id']], $items ?? []), 'creatives' => array_map(static fn ($c) => ['src' => $c['image'], 'url' => media($c['image']), 'video' => (bool) preg_match('/\.(mp4|webm)$/i', (string) $c['image'])], $creatives ?? []), 'i18n' => [ 'menu' => t_raw('vendor.screens.type_menu'), 'image' => t_raw('vendor.screens.type_image'), 'video' => t_raw('vendor.screens.type_video'), 'feature' => t_raw('vendor.screens.type_feature'), 'column' => t_raw('vendor.screens.column'), 'auto' => t_raw('vendor.screens.cat_auto'), 'items' => t_raw('vendor.screens.f_items'), 'width' => t_raw('vendor.screens.f_width'), 'category' => t_raw('vendor.screens.f_category'), 'heading' => t_raw('vendor.screens.f_heading'), 't_images' => t_raw('vendor.screens.t_images'), 't_numbers' => t_raw('vendor.screens.t_numbers'), 't_desc' => t_raw('vendor.screens.t_desc'), 't_calories' => t_raw('vendor.screens.t_calories'), 'cal_pos' => t_raw('vendor.screens.cal_pos'), 'cal_name' => t_raw('vendor.screens.cal_name'), 'cal_desc' => t_raw('vendor.screens.cal_desc'), 'cal_price' => t_raw('vendor.screens.cal_price'), 'show_hide' => t_raw('vendor.screens.t_show_hide'), 'upload' => t_raw('vendor.screens.media_upload'), 'youtube' => t_raw('vendor.screens.media_youtube'), 'pick' => t_raw('vendor.screens.media_pick_hint'), 'yt_ph' => t_raw('vendor.screens.youtube_ph'), 'choose' => t_raw('vendor.screens.feat_choose'), 'type' => t_raw('vendor.screens.f_type'), 'source' => t_raw('vendor.screens.f_source'), 'overlay_none' => t_raw('vendor.screens.overlay_none'), 'overlay_auto' => t_raw('vendor.screens.overlay_auto'), 'overlay_product' => t_raw('vendor.screens.overlay_product'), 'overlay_position' => t_raw('vendor.screens.overlay_position'), 'overlay_show' => t_raw('vendor.screens.overlay_show'), 'overlay_size' => t_raw('vendor.screens.overlay_size'), 'overlay_name' => t_raw('vendor.screens.overlay_name'), 'overlay_desc' => t_raw('vendor.screens.overlay_desc'), 'overlay_price' => t_raw('vendor.screens.overlay_price'), ], ]; @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp
{{ t_raw('vendor.screens.editor_sub') }}
{{ t_raw('vendor.screens.preview_note') }}