@endif
{{-- Top-boxes summary + empty-inventory shortcut are admin-only.
Non-admins with view access to at least one HasCalendarEvents
adopter reach this dashboard (see DashboardController::index),
but the count boxes read as global inventory and the create-
first-thing shortcuts assume admin-shaped permissions. The
widget section below stays visible for everyone since each
widget component already gates itself with @can and Companyable-
scopes its queries. --}}
@if (auth()->user()->hasAccess('admin'))
@endif
{{-- Empty-inventory shortcut is also admin-only. Non-admins take
the @else branch below and see the widget section, whose
queries Companyable-scope to what the caller can see. --}}
@if (auth()->user()->hasAccess('admin') && $counts['grand_total'] == 0)
@else
@endif
{{-- Adjust-quantity modal wiring for the low-stock widget's
inline replenish button. Same shared modal used on the
accessories / consumables / components index and view pages.
Included whenever the viewer can update any of the three item
types (one of those grants is what makes the button actually
appear in the widget). --}}
@if (Gate::allows('update', \App\Models\Consumable::class)
|| Gate::allows('update', \App\Models\Accessory::class)
|| Gate::allows('update', \App\Models\Component::class))
@endif
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', ['simple_view' => true, 'nopages' => true])
@can('canViewUsersAndCheckoutables')
{{-- Today widget for the dashboard. Reuses the main calendar
bundle. Initializes into listUpcoming view (rolling 7
days from today). No URL sync (widgets don't own the
page URL), no filter buttons (too tight for the
dashboard column), no toolbar (title suffices). Users
who want to filter head over to the full /calendar
page. Gate matches the widget component's own gate so
the JS bundle loads for every viewer the component
renders for, otherwise the widget div stays empty.
See resources/views/blade/dashboard/today-calendar.blade.php. --}}
@endcan
@stop
@push('js')
@endpush