@php $tz = config('app.display_timezone'); $tabMeta = ['mine' => ['label' => __('My reports'), 'icon' => 'clipboard-document-list']]; if ($seesTeam) { $tabMeta['team'] = ['label' => __('Team'), 'icon' => 'users']; } $statusColor = ['draft' => 'amber', 'submitted' => 'sky', 'reviewed' => 'emerald']; $myStatus = fn ($r) => $r ? \App\Models\Crm\WeeklyReport::STATUSES[$r->status] : __('Not started'); $cards = [ ['label' => __('This week'), 'value' => $myStatus($mine['this']), 'icon' => 'calendar-days', 'accent' => '#6366f1', 'sub' => __('Week of :date', ['date' => $thisWeek->format('j M')])], ['label' => __('Last week'), 'value' => $myStatus($mine['last']), 'icon' => 'clock', 'accent' => '#0ea5e9', 'sub' => __('Week of :date', ['date' => $lastWeek->format('j M')])], ]; if ($seesTeam) { $cards[] = ['label' => __('Team submitted'), 'value' => number_format($teamCounts['submitted']), 'icon' => 'check-circle', 'accent' => '#10b981', 'sub' => __('For this week')]; $cards[] = ['label' => __('Not submitted'), 'value' => number_format($missing->count()), 'icon' => 'exclamation-triangle', 'accent' => '#e11d48', 'sub' => __('BD officers, this week')]; $cards[] = ['label' => __('Awaiting review'), 'value' => number_format($teamCounts['awaiting']), 'icon' => 'clipboard-document-list', 'accent' => '#f59e0b', 'sub' => __('Submitted, not yet read')]; } @endphp
@if ($canWrite) @if (! $mine['last'] || ! $mine['last']->isSubmitted()) {{ $mine['last'] ? __('Finish last week\'s') : __('Write last week\'s') }} @endif {{ $mine['this'] ? __('Open this week\'s report') : __('Start this week\'s report') }} @endif
@foreach ($cards as $m)

{{ $m['label'] }}

{{ $m['value'] }}

{{ $m['sub'] }}
@endforeach
@if ($tab === 'team' && $missing->isNotEmpty())
{{ __('Not submitted for the week of :date:', ['date' => $thisWeek->format('j M')]) }} {{ $missing->pluck('name')->join(', ') }}
@endif
@foreach ($tabMeta as $key => $meta) @endforeach
@if ($tab === 'team') @endif
@if ($tab === 'team') @endif @forelse ($rows as $r) @if ($tab === 'team') @endif @empty @endforelse
{{ __('Week of') }}{{ __('Officer') }}{{ __('Next week\'s priorities') }} {{ __('Status') }} {{ __('Submitted') }} {{ __('Actions') }}
{{ $r->week_starting->format('j M Y') }}{{ $r->user?->name ?? __('Not available') }}{{ \Illuminate\Support\Str::limit((string) $r->priorities, 120) ?: __('Not written yet') }} {{ __(\App\Models\Crm\WeeklyReport::STATUSES[$r->status] ?? $r->status) }} @if ($r->reviewer) {{ __('by :name', ['name' => $r->reviewer->name]) }} @endif {{ $r->submitted_at?->timezone($tz)->format('j M Y, H:i') ?? __('Not submitted') }} {{ __('Open') }}
@if ($status !== '' || $officer !== '') @elseif ($tab === 'team') @else @endif
@if ($rows->hasPages())
{{ $rows->links() }}
@endif