Added buttons on license page, greyed out where appriate

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-04-16 15:23:42 -07:00
parent ff9af7ea74
commit add9e561f9

View file

@ -382,23 +382,35 @@
<div class="col-md-3">
@can('update', $license)
<a href="{{ route('licenses.edit', $license->id) }}" class="btn btn-block btn-default" style="margin-bottom: 10px;">{{ trans('admin/licenses/general.edit') }}</a>
<a href="{{ route('clone/license', $license->id) }}" class="btn btn-block btn-default" style="margin-bottom: 10px;">{{ trans('admin/licenses/general.clone') }}</a>
<a href="{{ route('licenses.edit', $license->id) }}" class="btn btn-block btn-primary" style="margin-bottom: 10px;">{{ trans('admin/licenses/general.edit') }}</a>
<a href="{{ route('clone/license', $license->id) }}" class="btn btn-block btn-primary" style="margin-bottom: 25px;">{{ trans('admin/licenses/general.clone') }}</a>
@endcan
@can('checkout', $license)
@if ($license->availCount()->count() > 0)
<a href="{{ route('licenses.checkout', $license->id) }}" class="btn-block btn bg-maroon" style="margin-bottom: 10px;">Checkout</a>
<a href="{{ route('licenses.edit', $license->id) }}" class="btn-block btn bg-maroon" style="margin-bottom: 10px;">Checkout Remaining to All Users</a>
<a href="{{ route('licenses.checkout', $license->id) }}" class="btn-block btn bg-maroon" style="margin-bottom: 10px;" data-toggle="tooltip" title="{{ trans('general.checkout') }}">
Checkout
</a>
<a href="#" class="btn-block btn bg-maroon" style="margin-bottom: 10px;" style="margin-bottom: 10px;" data-toggle="modal" data-tooltip="true" data-target="#checkoutFromAllModal">Checkout Remaining to All Users</a>
@else
<a href="{{ route('licenses.checkout', $license->id) }}" class="btn btn-block bg-maroon disabled" style="margin-bottom: 10px;">Checkout</a>
<a href="{{ route('licenses.edit', $license->id) }}" class="btn btn-block bg-maroon disabled" style="margin-bottom: 10px;">Checkout Remaining to All Users</a>
<a href="{{ route('licenses.checkout', $license->id) }}" class="btn btn-block bg-maroon disabled">
Checkout
</a>
<a href="#" class="btn btn-block bg-maroon disabled" style="margin-bottom: 10px;">
Checkout Remaining to All Users
</a>
@endif
@endcan
@can('checkin', $license)
@if (($license->seats - $license->availCount()->count()) > 0 )
<a href="{{ route('licenses.edit', $license->id) }}" class="btn btn-block bg-purple" style="margin-bottom: 10px;">Checkin All</a>
<a href="#" class="btn btn-block bg-purple" style="margin-bottom: 10px;" data-toggle="modal" data-tooltip="true" data-target="#checkinFromAllModal" data-toggle="tooltip" title="Checkin all checked out seats for this license">
Checkin All
</a>
@else
<a href="#" class="btn btn-block bg-purple disabled" style="margin-bottom: 10px;" data-tooltip="true" data-toggle="tooltip" title="This is disabled because there is nothing to checkin">
Checkin All
</a>
@endif
@endcan
@ -592,8 +604,24 @@
</div> <!-- /.row -->
@can('update', \App\Models\License::class)
@include ('modals.confirm-action', ['item_type' => 'user', 'item_id' => $user->id])
@can('checkin', \App\Models\License::class)
@include ('modals.confirm-action',
[
'modal_name' => 'checkinFromAllModal',
'route' => route('licenses.bulkcheckin', $license->id),
'title' => trans('general.license_checkin_all_confirm_modal_header'),
'body' => trans_choice('general.license_checkin_all_confirm_modal_body', 2, ['count' => ($license->seats - $license->availCount()->count())])
])
@endcan
@can('checkout', \App\Models\License::class)
@include ('modals.confirm-action',
[
'modal_name' => 'checkoutFromAllModal',
'route' => route('licenses.bulkcheckout', $license->id),
'title' => trans('general.license_checkout_all_confirm_modal_header'),
'body' => trans_choice('general.license_checkout_all_confirm_modal_body', 2, ['count' => $license->availCount()->count()])
])
@endcan
@can('update', \App\Models\License::class)