@extends('layouts.admin') @section('title', '儀表板') @push('breadcrumb') @endpush @push('styles') @endpush @section('content')

儀表板總覽

歡迎回來,{{ auth()->user()->name ?? '系統管理員' }}

{{ now()->format('Y-m-d H:i') }}
@php use App\Support\PagePermissions; $canEditDashboard = PagePermissions::canEdit(auth()->user(), 'dashboard'); @endphp
@foreach($cards as $card) @php $collapseId = 'setting-'.$card['key']; $listId = 'list-'.$card['key']; $timeFormat = !empty($card['with_time']); $overdueHidden = ! $card['show_overdue']; $visibleRows = 0; @endphp
{{ $card['title'] }} {{ $card['items']->count() }} 明天 3天內 7天內 @if($canEditDashboard) @else {{ $card['window'] }} {{ $card['unit'] }}內到期 @endif
@if($canEditDashboard)
@csrf
{{ $card['unit'] }}內到期 @if($card['overdue_count'] > 0) @endif
@endif
@foreach($card['groups'] as $group) @php $groupSkipped = !empty($group['overdue']) && $overdueHidden; @endphp
{{ $group['label'] }} {{ $group['items']->count() }}
@foreach($group['items'] as $item) @php // 整張卡合計只留前 N 條;收起的分組不佔名額 $isOverflow = ! $groupSkipped && $visibleRows >= $displayLimit; if (! $groupSkipped) { $visibleRows++; } @endphp
@if($item->url) {{ $item->title }} @else {{ $item->title }} @endif @if($item->sub){{ $item->sub }}@endif {{ $item->date?->format($timeFormat ? 'Y-m-d H:i' : 'Y-m-d') }} @if($item->is_overdue)已過期@endif
@if($item->people)
@foreach($item->people as $person){{ $person->name }}{{ ! $loop->last ? '、' : '' }}@endforeach
@endif
@endforeach
@endforeach @if($card['groups'] === [])
{{ $card['empty_text'] }}
@endif
@if($card['items']->count() > $displayLimit)
@endif
@endforeach
@endsection @push('scripts') @endpush