@php /** * Getting a menu in and out — the whole of it, in one place. * * What this replaces: choosing a radio, filling a panel, naming the result and pressing Read — * four steps of ceremony for one job — with CSV buried inside "upload a file" and its own Export * living on a different screen. Here each way in is ONE click that starts immediately, import * and export of the same format sit together, and a saved import is a working document you can * rename, take to a spreadsheet, and bring back. * * The three entries are read from App\Services\MenuImportMethod, so a fourth way in is one * registry entry and no change here. * * @var array $drafts imports awaiting review * @var string $exportQs active filter/sort carried onto the menu export link */ use App\Services\MenuImportMethod; $drafts = $drafts ?? []; $exportQs = (string) ($exportQs ?? ''); // listed(), not offered(): a method the platform has switched off is still shown, greyed, so the // capability is discoverable instead of merely absent. $methods = MenuImportMethod::listed(); // On the Import page the methods are already the vertical nav, so this partial contributes only // the saved menus and the export beside them — rendering the tiles again would be the same // screen offering the same six choices twice. $listOnly = !empty($listOnly); @endphp
| {{ t_raw('vendor.menu.draft_col_name') }} | {{ t_raw('vendor.menu.draft_col_source') }} | {{ t_raw('vendor.menu.draft_col_dishes') }} | {{ t_raw('common.date') }} | {{ t_raw('common.actions') }} |
|---|---|---|---|---|
| {{ (string) $d['name'] }} | {{ MenuImportMethod::label(MenuImportMethod::ofInput((string) $d['source'])) }} | {{ number_format((int) $d['dish_count']) }} | {!! fmt_datetime((string) $d['created_at']) !!} | @php /* The shared row-actions component: the two constant actions stay inline, the rest fold behind ⋮ — so a row reads calmly. */ @endphp @partial('row-actions', ['actions' => [ ['label' => t_raw('vendor.menu.draft_resume_btn'), 'icon' => 'fa-eye', 'primary' => true, 'href' => '/vendor/menu/import?draft=' . $id], ['label' => t_raw('vendor.menu.draft_export_btn'), 'icon' => 'fa-file-csv', 'href' => '/vendor/menu/import/export?draft=' . $id], ['label' => t_raw('vendor.menu.draft_rename_btn'), 'icon' => 'fa-pen', 'attrs' => ['data-draft-rename' => '1', 'data-id' => (string) $id, 'data-name' => (string) $d['name'], 'data-bs-toggle' => 'modal', 'data-bs-target' => '#draftModal']], ['label' => t_raw('vendor.menu.draft_discard_btn'), 'icon' => 'fa-trash-alt', 'danger' => true, 'form' => ['action' => '/vendor/menu/import/delete', 'fields' => ['draft' => $id], 'confirm' => t_raw('vendor.menu.draft_confirm_delete')]], ]]) |