@extends('layouts.dashboard') @section('content') @php /** * "Get started" — the restaurant's setup console (app.css §35h). A sticky * summary rail — the completion figure over a hairline meter, stage anchors, * and the single accent CTA pointing at the next open step — beside a flat * task list: one bordered card per stage, hairline-separated rows, open work * sorted first (required, then optional), finished rows dimmed to a thin * grey tick. Colour is rationed to the CTA and the required markers. * Same read-only scorer (App\Services\Setup), same keys, same links. * * @var array $progress @var array|null $restaurant */ $p = $progress; // Steps, not scorer weights: the weighted score can reach 100 while required // work is still open, and a "complete" headline beside outstanding required // rows reads as a broken page. done/total matches the list below. $score = (int) $p['total'] > 0 ? (int) floor(((int) $p['done'] / (int) $p['total']) * 100) : 0; $allDone = (int) $p['done'] >= (int) $p['total']; $reqLeft = (int) $p['requiredTotal'] - (int) $p['requiredDone']; $optLeft = ((int) $p['total'] - (int) $p['done']) - $reqLeft; // "You are here": the first outstanding required step anywhere, else the first // optional one still open. The rail CTA points at it; its row carries the bar. $next = null; $curGi = null; foreach (['required', 'skipped'] as $want) { foreach ($p['groups'] as $gi => $g) { foreach ($g['steps'] as $s) { if ($s['status'] === $want) { $next = $s; $curGi = $gi; break 3; } } } } // Open work first — required, then optional — finished rows last. usort() is // stable on PHP 8, so the scorer's own order holds within each band. $rank = static fn (array $s): int => $s['status'] === 'required' ? 0 : ($s['status'] === 'skipped' ? 1 : 2); @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp
@if (!empty($restaurant)){!! restaurant_logo_html($restaurant, 'sm') !!}@endif {{ (string) ($restaurant['name'] ?? '') }}

@if ($allDone){{ t_raw('vendor.setup.title_complete') }} @elseif ($p['requiredComplete']){{ t_raw('vendor.setup.title_ready') }} @else{{ t_raw('vendor.setup.title_todo') }}@endif

@if ($p['requiredComplete']) {{ t_raw('vendor.setup.all_essential_done') }} {!! $optLeft > 0 ? t($optLeft === 1 ? 'vendor.setup.optional_left_singular' : 'vendor.setup.optional_left_plural', [':n' => $optLeft]) : t('vendor.setup.all_extra_configured') !!} @else {{ t_raw($reqLeft === 1 ? 'vendor.setup.required_left_singular' : 'vendor.setup.required_left_plural', [':n' => $reqLeft]) }} @endif

{{ $score }}% {{ (int) $p['done'] }} / {{ (int) $p['total'] }}
@if ($next !== null) {{ $next['label'] }} @else {{ t_raw('nav.dashboard') }} @endif
@foreach ($p['groups'] as $gi => $g) @php $steps = $g['steps']; usort($steps, static fn (array $a, array $b): int => $rank($a) <=> $rank($b)); @endphp

{{ $g['title'] }}

{{ $g['sub'] }}

{{ (int) $g['done'] }}/{{ (int) $g['total'] }}
@endforeach
@php /* /.qm-d2 */ @endphp @endsection