@php
use App\Support\Bytes;
use Illuminate\Support\Number;
$locale = app()->getLocale();
$money = fn (int $cents, string $currency) => Number::currency($cents / 100, in: $currency, locale: $locale);
@endphp
{{-- Page head. The same pill the public site uses to label a section, so a
customer meets one vocabulary on both sides of the login. --}}
{{ __('dashboard.sheet', ['when' => $asOf->locale($locale)->isoFormat('LL, LT')]) }}
{{ $instance !== null ? __('dashboard.title_running') : __('dashboard.title_pending') }}
@if ($instance !== null)
$instance->status === 'active',
'border-warning-border bg-warning-bg text-warning' => $instance->status !== 'active',
])>
{{ __('dashboard.instance_status.'.$instance->status) }}
@if ($domain)
{{ __('dashboard.cloud.open') }}
@endif
@endif
{{-- Live provisioning progress (only while a run is in flight) --}}
@if ($instance === null)
{{-- Said plainly rather than papered over with an empty record: a page
of dashes reads as broken, and "we are still setting it up" and
"you have not ordered yet" are different things. --}}
{{ __('dashboard.no_instance_label') }}
{{ __('dashboard.no_instance_body') }}
{{ __('dashboard.no_instance_cta') }}
{{ __('dashboard.nav.support') }}
@else
{{-- ── What the customer has ─────────────────────────────────────── --}}
@if ($instance->quota_gb)
{{ __('dashboard.master.storage') }}
{{ __('dashboard.master.gb', ['n' => $instance->quota_gb]) }}
{{-- Consumption is not metered yet. An invented "used"
figure on the sheet a customer forwards to their
auditor is the one thing this page must never do. --}}
{{ __('dashboard.master.storage_note') }}
@endif
{{ __('dashboard.master.users') }}
{{ $seats['total'] !== null
? __('dashboard.master.of_total', ['used' => $seats['used'], 'total' => $seats['total']])
: $seats['used'] }}
@if ($seats['total'])
{{-- R4: width is data, not decoration. --}}
@endif
@if ($traffic)
@php $state = $traffic->state(); @endphp
{{ __('dashboard.traffic.title') }}
{{ Bytes::human($traffic->usedBytes) }}
$state === 'ok',
'bg-warning' => $state === 'warn' || $state === 'critical',
'bg-danger' => $state === 'exhausted',
])
style="width: {{ min(100, $traffic->percent()) }}%">
{{ __('dashboard.traffic.of', ['total' => Bytes::human($traffic->quotaBytes)]) }}
@if ($state !== 'ok')
{{-- The offer belongs next to the warning: someone
reading that they are nearly out should not have to
go looking for the way to fix it. --}}
{{ __('dashboard.traffic.buy') }}
@endif
@endif
@if ($location)
{{ __('dashboard.master.location') }}
{{ $location['name'] }}
@if ($location['note'])
{{ $location['note'] }}
@endif
@endif
{{-- ── The proof register ────────────────────────────────────── --}}
@if ($proofs === [])
{{ __('dashboard.proofs.empty') }}
@else
@foreach ($proofs as $proof)
|
{{ __('dashboard.proofs.item.'.$proof['key']) }}
{{ $proof['at']?->locale($locale)->isoFormat('DD.MM. HH:mm') ?? '—' }}@if ($proof['note']) · {{ $proof['note'] }}@endif
|
$proof['state'] === 'ok',
'border-info-border bg-info-bg text-info' => $proof['state'] === 'planned',
'border-danger-border bg-danger-bg text-danger' => $proof['state'] === 'attention',
])>
{{ __('dashboard.proofs.state.'.$proof['state']) }}
|
@endforeach
@endif
{{-- ── The contract ───────────────────────────────────────── --}}
{{ __('dashboard.master.label') }}
- {{ __('dashboard.master.package') }}
-
{{ __('billing.plan.'.($instance->plan ?: 'team')) }}
@if ($planPrice)
{{ __('dashboard.master.per_'.($planPrice['term'] === 'yearly' ? 'year' : 'month'), ['amount' => $money($planPrice['cents'], $planPrice['currency'])]) }}
@endif
@if ($contract?->performance)
- {{ __('dashboard.master.operation') }}
- {{ __('billing.perf.'.$contract->performance) }}
@endif
@if ($domain)
- {{ __('dashboard.master.address') }}
- {{ $domain }}
@endif
@if ($nextInvoice)
{{ __('dashboard.invoice.label') }}
@if ($nextInvoice['addons'] > 0)
{{-- Broken out only when there is something to
break out: a "Module 0,00 €" line on every
other customer's sheet is noise. --}}
- {{ __('dashboard.invoice.plan') }}
- {{ $money($nextInvoice['plan'], $nextInvoice['currency']) }}
- {{ __('dashboard.invoice.addons') }}
- {{ $money($nextInvoice['addons'], $nextInvoice['currency']) }}
@endif
- {{ __('dashboard.invoice.amount') }}
-
{{ $money($nextInvoice['total'], $nextInvoice['currency']) }}
{{ __('dashboard.invoice.net') }}
- {{ __('dashboard.invoice.due') }}
- {{ $nextInvoice['due']?->locale($locale)->isoFormat('LL') ?? '—' }}
{{ __('dashboard.invoice.all') }}
@endif
@if ($openTasks > 0)
{{-- Only while there is something outstanding. A permanently
green checklist is furniture; one with work left on it
is a reason to open this page. --}}
{{ __('dashboard.setup.label') }}
{{ trans_choice('dashboard.setup.open', $openTasks, ['count' => $openTasks]) }}
{{ __('dashboard.setup.continue') }}
@endif
{{-- ── The three things customers come here to do ─────────────────── --}}
@foreach ([
['users', 'users', 'add_user'],
['backups', 'rotate-ccw', 'restore'],
['billing', 'plus', 'grow'],
] as [$route, $icon, $key])
{{ __('dashboard.quick.'.$key.'_title') }}
{{ __('dashboard.quick.'.$key.'_body') }}
@endforeach
@endif