@php /* | Partial render. | | A filtered listing asks for the same URL it would navigate to, with a | header saying it only wants the content. Returning the shell as well | would mean re-rendering the sidebar and its permission checks, and | re-sending link tags the browser already has, on every keystroke. | | The route, the controller and the view are untouched by this: the same | page is produced either way, so there is no second render path to drift | out of sync with the first. Without JavaScript the header is never sent | and the full page is served exactly as before. | | Two kinds of partial, told apart by the header's value. | | content — a filtered listing. Only the region the filter replaces. | page — a sidebar navigation. Everything inside
: the banner, | the flash and the content, because a navigation lands on a | page whose "saved" notice has to arrive with it. | | Anything else, including a bare header with no value, is treated as | `content` so a browser holding a cached copy of the old script keeps | working exactly as it did. */ $partial = request()->header('X-Clinic-Partial'); @endphp @if ($partial === 'page') {{-- The document title travels with the markup: swapping the content without it leaves the browser tab naming the previous screen. --}} @include('partials.license-banner') @include('partials.flash') @yield('content') @elseif ($partial) @yield('content') @else @php /** @var array $locales */ $locales = config('clinic.locales', []); $direction = $locales[app()->getLocale()]['dir'] ?? 'ltr'; /* | The theme is resolved server-side from the cookie the toggle writes, so | the first paint is already correct. The CSP sets script-src 'self', | which rules out the usual inline "read the preference before render" | snippet, and a flash of the wrong theme looks broken on a screen staff | open dozens of times a day. */ $theme = request()->cookie('clinic_theme') === 'dark' ? 'dark' : 'light'; @endphp @yield('title', __('common.dashboard')) · {{ config('clinic.product.name') }} @vite(['resources/css/app.scss', 'resources/js/app.js']) {{-- The clinic's own accent, when they have chosen one. After the stylesheet so it wins, and absent altogether when the clinic is using the colour the product ships with — there is no sense sending a rule that restates the default on every page. Printed with {{ }} rather than {!! !!} deliberately. The value is already validated as a hex colour, and escaping means that even if that ever stopped being true, no `` could be smuggled through here. --}} @if (! empty($brandingCss)) @endif @stack('styles') {{-- Skip link: clinical staff work at speed and many navigate by keyboard only. --}}
@include('partials.sidebar')
@include('partials.topbar')
@include('partials.license-banner') @include('partials.flash') @yield('content')
@stack('scripts') @endif