@extends('layouts.dashboard') @section('content') @php /** * "Get started" — the platform'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\AdminSetup), same keys, same links. * * @var array $progress */ $p = $progress; // The rail speaks in STEPS, not scorer weights: the weighted score can reach // 100 while required work is still open (weights sum past 100 by design), and // a "fully set up" headline beside outstanding required rows reads as a // broken page. done/total is the same truth the list below shows. $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 ($p['requiredComplete']) {!! $optLeft > 0 ? t($optLeft === 1 ? 'admin.setup.hero_sub_optional_left_one' : 'admin.setup.hero_sub_optional_left_many', [':count' => $optLeft]) : t('admin.setup.hero_sub_all_done') !!} @else {{ t_raw($reqLeft === 1 ? 'admin.setup.hero_sub_required_left_one' : 'admin.setup.hero_sub_required_left_many', [':count' => $reqLeft]) }} @endif
{{ $g['sub'] }}
{{ (int) $g['done'] }}/{{ (int) $g['total'] }}