@extends("admin.layouts.app") @section("title", __("admin.dashboard.title")) @section("content") @if(!empty($setup) && !$setup['complete'])
{{ __('admin.setup.title') }} {{ __('admin.setup.progress', ['done' => $setup['done'], 'total' => $setup['total']]) }}
{{ __('admin.setup.open_guide') }} →
@foreach($setup['items'] as $item) @php // The tick is only in the markup when the step is actually done. // It used to be printed for every step and hidden with // color:transparent, so copied text and screen readers reported // five completed steps next to a counter reading "0 of 5". $stepState = $item['done'] ? __('client.status.completed') : __('admin.pending'); $stepMissing = ! $item['done'] && ! empty($item['missing']) ? implode(', ', $item['missing']) : null; @endphp {{ __('admin.setup.step_' . $item['key']) }} @if($stepMissing) {{-- Which half is still outstanding, rather than leaving the operator to guess why nothing moved. --}} ({{ $stepMissing }}) @endif @endforeach
@endif @php $me = auth('admin')->user(); @endphp
{{ __('admin.dashboard.quick_actions') }}
@if($me && $me->hasPermission('manage_products')) + {{ __('admin.dashboard.new_product') }} @endif @if($me && $me->hasPermission('manage_servers')) + {{ __('admin.dashboard.add_server') }} @endif @if($me && $me->hasPermission('create_clients')) + {{ __('admin.dashboard.add_client') }} @endif @if($me && $me->hasPermission('create_invoices')) + {{ __('admin.dashboard.new_invoice') }} @endif {{-- Second half: the screens an operator opens over and over. Creating things was one click away and reaching the screens that manage them was three, through a sidebar tree. --}} @php $jumps = array_values(array_filter([ $me?->hasPermission('manage_gateways') ? ['admin.config.gateways', __('admin.dashboard.payments')] : null, $me?->hasPermission('manage_products') ? ['admin.products.index', __('admin.dashboard.products')] : null, $me?->hasPermission('manage_servers') ? ['admin.config.servers', __('admin.dashboard.servers')] : null, $me?->hasPermission('manage_servers') ? ['admin.live-servers.index', __('admin.dashboard.live_servers')] : null, $me?->hasPermission('manage_domains') ? ['admin.config.domain-pricing', __('admin.dashboard.domains')] : null, ])); @endphp @if($jumps) {{-- The rule is drawn only when there is something on both sides of it. --}} @foreach($jumps as [$route, $label]) {{ $label }} @endforeach @endif
{{-- What is actually waiting. A count that is zero is left out entirely: an operator should be able to tell at a glance that there is nothing to do, and a row of zeroes does not say that, it just adds reading. --}} @if(!empty($waiting))
{{ __('admin.dashboard.needs_attention') }} @if(!empty($waiting['orders'])) {{ $waiting['orders'] }} {{ __('admin.dashboard.pending_orders') }} @endif @if(!empty($waiting['invoices'])) {{ $waiting['invoices'] }} {{ __('admin.dashboard.unpaid_invoices') }} @endif @if(!empty($waiting['tickets'])) {{ $waiting['tickets'] }} {{ __('admin.dashboard.open_tickets') }} @endif {{-- Money may have moved and nobody can say. Red, because it is the only thing on this line that cannot wait for somebody to feel like it. --}} @if(!empty($waiting['charge_review'])) {{ $waiting['charge_review'] }} {{ __('admin.dashboard.charges_need_review') }} @endif
@endif
@foreach($widgetOutput as $key => $item) @php $widget = $item['widget']; $cols = $widget->getColumns(); @endphp @if($cols === 4) {{-- Full-width widget --}}
{!! $item['html'] !!}
@else @if($loop->first || ($widgetOutput[array_keys($widgetOutput)[$loop->index - 1] ?? '']['widget'] ?? null)?->getColumns() === 4 || $cols === 2 && !isset($gridOpen)) @php $gridOpen = true; @endphp
@endif
{{ $widget->getTitle() }} {{ $widget->getDescription() }}
{!! $item['html'] !!}
@if($loop->last)
@php unset($gridOpen); @endphp @endif @endif @endforeach
@endsection