Use totals for sidebar

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-04-26 19:12:21 +01:00
parent 52d6a8990a
commit 860764a436
2 changed files with 5 additions and 2 deletions

View file

@ -102,6 +102,9 @@ class AssetCountForSidebar
\Log::debug($e);
}
view()->share('total_due_and_overdue_for_checkin', ($total_due_for_checkin + $total_overdue_for_checkin));
view()->share('total_due_and_overdue_for_audit', ($total_due_for_audit + $total_overdue_for_audit));
return $next($request);
}
}

View file

@ -509,7 +509,7 @@
<li{!! (Request::is('hardware/audit/due') ? ' class="active"' : '') !!}>
<a href="{{ route('assets.audit.due') }}">
<i class="fas fa-history text-yellow fa-fw"></i> {{ trans('general.audit_due') }}
<badge class="badge">{{ (isset($total_due_for_audit)) ? $total_due_for_audit : '' }}</badge>
<badge class="badge">{{ (isset($total_due_and_overdue_for_audit)) ? $total_due_and_overdue_for_audit : '' }}</badge>
</a>
</li>
@endcan
@ -518,7 +518,7 @@
<li{!! (Request::is('hardware/checkins/due') ? ' class="active"' : '') !!}>
<a href="{{ route('assets.checkins.due') }}">
<i class="fas fa-history text-yellow fa-fw"></i> {{ trans('general.checkin_due') }}
<badge class="badge">{{ (isset($total_overdue_for_checkin)) ? $total_overdue_for_checkin : '' }}</badge>
<badge class="badge">{{ (isset($total_due_and_overdue_for_checkin)) ? $total_due_and_overdue_for_checkin : '' }}</badge>
</a>
</li>
@endcan