Skip to content

Commit

Permalink
Use totals for sidebar
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <snipe@snipe.net>
  • Loading branch information
snipe committed Apr 26, 2024
1 parent 52d6a89 commit 860764a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/Http/Middleware/AssetCountForSidebar.php
Expand Up @@ -102,6 +102,9 @@ public function handle($request, Closure $next)
\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);
}
}
4 changes: 2 additions & 2 deletions resources/views/layouts/default.blade.php
Expand Up @@ -509,7 +509,7 @@ class="fas fa-check text-blue fa-fw"></i>
<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
Expand All @@ -518,7 +518,7 @@ class="fas fa-check text-blue fa-fw"></i>
<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
Expand Down

0 comments on commit 860764a

Please sign in to comment.