{{-- Start (DESIGN.md Page patterns 1, dashboard; #2957 slice 1). Same data as before the reskin: the company's last five sendouts starting up to a week ahead, and the month summary from Company::sumMonthStats(). Unread notices get their own card only when there are any. --}} @extends('layouts.nuhet') @php $user = Auth::user(); $company = $user->company; $firstName = trim((string) $user->first_name) !== '' ? $user->first_name : $user->username; $sendouts = $company->sendouts()->where('start_time', '<=', \Carbon\Carbon::now()->addWeek())->limit(5)->orderBy('start_time', 'DESC')->get(); $month = $company->sumMonthStats(); $notices = $company->unreadNotices(); $percentOf = fn ($part) => $month['emails_sent'] > 0 ? $part / $month['emails_sent'] * 100 : 0; $percentText = fn ($part) => formatNumber($percentOf($part)).' %'; $latest = $sendouts->first(fn ($sendout) => in_array($sendout->statusType(), [1, 3], true)); // "Kom igÄng" (#3176): null once every step is done or the company has hidden it. $onboarding = app(\App\Services\Onboarding\OnboardingChecklist::class)->forCompany($company, $user); @endphp @section('_pageTitle', trans('home.index.pageTitle', ['name' => $user->fullname()])) @section('pagename', trans('navigation.dashboard')) @section('banners') @include('partials.nh-account-banners') @endsection @section('page')
{{ __('home.start.lead', ['company' => $company->name]) }}
{{ __('sendout.summary.header', ['month' => __('global.month.'.date('n'))]) }}
{{ __('dashboard.sendout.empty') }}
@else{{ $latest->subject }}
{{ __($pill === 'done' ? 'home.start.latestSent' : 'home.start.latestStarted', ['date' => \App\Support\DisplayDate::timestamp($latest->start_time)]) }}
{{ __('home.start.latestHint') }}
{{ __('home.start.latestEmpty') }}
@endif