@php use Illuminate\Support\Str; $initials = fn (?string $name) => strtoupper(collect(explode(' ', trim((string) $name))) ->filter()->map(fn ($p) => mb_substr($p, 0, 1))->take(2)->implode('')) ?: '?'; $eur = fn ($n) => '€'.number_format((float) $n, 0); $periods = ['today' => 'Today', '7days' => '7 days', '30days' => '30 days', 'year' => 'YTD']; $sparkMax = max(1, max($sparkline)); @endphp {{ $isSuper ? 'Approvals required' : 'My requests' }} {{ $approvalsCount }} Tasks outstanding {{ $openTasks }} New task {{-- Global timeframe (drives the money KPIs + registrations only) --}} Timeframe @foreach ($periods as $key => $label) {{ $label }} @endforeach Showing {{ $rangeLabel }} {{-- KPI tiles --}}
{{ $eur($money['raised']) }} {{ number_format($money['count']) }} {{ $eur($money['average']) }} {{ number_format($activeGroups) }}
{{-- Hero: campaign progress + 14-day sparkline --}}
Campaign progress
{{ $eur($money['raised']) }}raised {{ $rangeLabel }}
{{ number_format($money['count']) }} donations · avg {{ $eur($money['average']) }} · {{ number_format($users['active']) }} active fundraisers
@if ($campaignGoal > 0)
Campaign to date {{ $eur($campaignRaised) }} of {{ $eur($campaignGoal) }} · {{ $campaignPct }}%
@else
Campaign to date: {{ $eur($campaignRaised) }} · set a campaign goal in Controlled Settings to show a target.
@endif
Donations · last 14 days {{ $eur(array_sum($sparkline)) }}
@php $sparkDays = count($sparkline); @endphp @foreach ($sparkline as $i => $d) @php $barDate = now()->subDays($sparkDays - 1 - $i); $isToday = $i === $sparkDays - 1; @endphp
@endforeach
{{ now()->subDays(13)->format('j M') }}Today
{{-- Registrations & users (same timeframe) --}}

Registrations & users · {{ $rangeLabel }}

All users →

Active users = received a donation in the period. Awaiting activation = registered but not yet verified.

{{-- Left column --}}
{{-- Approvals (role-aware) --}} {{ $isSuper ? 'Open queue' : 'View all' }} →
@forelse ($approvals as $r)
{{ $r->action->label() }}Pending
{{ $r->requester?->full_name ?: $r->requested_by }} · {{ $r->reason ?: 'change request' }}
{{ $r->requested_at?->diffForHumans(short: true) }}
@empty

{{ $isSuper ? 'Nothing awaiting approval.' : 'You have no pending requests.' }}

@endforelse
{{-- Top fundraisers --}} All fundraisers →
@forelse ($topFundraisers as $i => $f)
{{ $i + 1 }} {{ $initials($f['name']) }}
{{ $f['name'] }}
{{ $eur($f['raised']) }} of {{ $eur($f['goal']) }} target
@empty

No fundraiser totals yet.

@endforelse
{{-- Top groups --}} All groups →
@forelse ($topGroups as $row) @php $g = $row['model']; @endphp
{{ $g->name }}
{{ $row['members'] }} members · {{ $eur($row['raised']) }} of {{ $eur($g->goal) }}
@empty

No groups yet.

@endforelse
{{-- Right column --}}
{{-- My tasks --}} All tasks →
@forelse ($tasks as $t)
{{ $t->title }} @php $due = $t->due_at; $overdue = $t->isOverdue(); @endphp {{ $due ? ($due->isToday() ? 'Today' : $due->format('j M')) : 'No date' }}
@empty

You're all caught up — no open tasks.

@endforelse
{{-- Needs attention --}}
@forelse ($attention as $row)
{{ $row['label'] }} {{ number_format($row['count']) }}
@empty
Nothing needs attention right now.
@endforelse
@if ($isSuper) {{-- process.yspi.ie integrations health (D83 email gate + D84 registration). --}} @php $stateMeta = [ 'ok' => ['OK', 'success', 'fa-circle-check', 'var(--success)'], 'unconfigured' => ['Not configured', 'neutral', 'fa-circle-minus', 'var(--ink-soft)'], 'forbidden' => ['Missing ability', 'coral', 'fa-circle-exclamation', 'var(--coral)'], 'unauthorized' => ['Bad token', 'coral', 'fa-circle-exclamation', 'var(--coral)'], 'unreachable' => ['Unreachable', 'amber', 'fa-triangle-exclamation', 'var(--coral)'], 'error' => ['Error', 'coral', 'fa-circle-exclamation', 'var(--coral)'], ]; @endphp @if ($processStatus)checked {{ \Illuminate\Support\Carbon::parse($processStatus['checked_at'])->diffForHumans() }}@endif
@if (! $processStatus)
Not checked yet — refreshes every 30 min, or run php artisan process:check.
@else @foreach (['email', 'registration'] as $k) @php $r = $processStatus[$k]; $m = $stateMeta[$r['state']] ?? $stateMeta['error']; @endphp
{{ $r['label'] }} · {{ $r['ability'] }} {{ $m[0] }}
@endforeach

{{ $processStatus['email']['base_url'] }}

@endif
@endif