Wrap disabled <a> links in a span for tooltips

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-05-31 19:29:29 +01:00
parent 3005565bba
commit a15ed6eaee
3 changed files with 16 additions and 9 deletions

View file

@ -71,7 +71,7 @@ class AssetCheckoutController extends Controller
if (!$asset->model) {
return redirect()->route('hardware.show', $asset->id)->with('error', trans('admin/hardware/general.model_invalid_fix'));
}
$admin = Auth::user();
$target = $this->determineCheckoutTarget();

View file

@ -46,9 +46,10 @@
{{ $asset->model->name }}
@else
<span class="text-danger text-bold">
<i class="fas fa-exclamation-triangle" aria-hidden="true"></i>
{{ trans('admin/hardware/general.model_invalid')}}
</span>
<i class="fas fa-exclamation-triangle" aria-hidden="true"></i>
{{ trans('admin/hardware/general.model_invalid')}}
</span>
{{ trans('admin/hardware/general.model_invalid_fix')}}
<a href="{{ route('hardware.edit', $asset->id) }}">
<strong>{{ trans('admin/hardware/general.edit') }}</strong>

View file

@ -867,7 +867,7 @@
'id' => 'bulkForm']) }}
<input type="hidden" name="bulk_actions" value="labels" />
<input type="hidden" name="ids[{{$asset->id}}]" value="{{ $asset->id }}" />
<button class="btn btn-sm btn-default" id="bulkEdit" ><i class="fas fa-barcode" aria-hidden="true"></i> {{ trans_choice('button.generate_labels', 1) }}</button>
<button class="btn btn-sm btn-default" id="bulkEdit"{{ (!$asset->model ? ' disabled' : '') }}{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.model_invalid').'"' : '') !!}><i class="fas fa-barcode" aria-hidden="true"></i> {{ trans_choice('button.generate_labels', 1) }}</button>
{{ Form::close() }}
@ -895,17 +895,21 @@
@if (($asset->assigned_to != '') && ($asset->deleted_at==''))
@can('checkin', \App\Models\Asset::class)
<div class="col-md-12">
<a href="{{ route('hardware.checkin.create', $asset->id) }}" class="btn btn-sm btn-primary btn-block hidden-print{{ (!$asset->model ? ' disabled' : '') }}"{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.model_invalid_fix').'" disabled' : '') !!}>
<span class="tooltip-wrapper"{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.model_invalid_fix').'"' : '') !!}>
<a role="button" href="{{ route('hardware.checkin.create', $asset->id) }}" class="btn btn-sm btn-primary btn-block hidden-print{{ (!$asset->model ? ' disabled' : '') }}">
{{ trans('admin/hardware/general.checkin') }}
</a>
</span>
</div>
@endcan
@elseif (($asset->assigned_to == '') && ($asset->deleted_at==''))
@can('checkout', \App\Models\Asset::class)
<div class="col-md-12" style="padding-top: 5px;">
<a href="{{ route('hardware.checkout.create', $asset->id) }}" class="btn btn-sm btn-primary btn-block hidden-print{{ (!$asset->model ? ' disabled' : '') }}"{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.model_invalid_fix').'" disabled' : '') !!}>
<span class="tooltip-wrapper"{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.model_invalid_fix').'"' : '') !!}>
<a href="{{ route('hardware.checkout.create', $asset->id) }}" class="btn btn-sm btn-primary btn-block hidden-print{{ (!$asset->model ? ' disabled' : '') }}">
{{ trans('admin/hardware/general.checkout') }}
</a>
</span>
</div>
@endcan
@endif
@ -932,9 +936,11 @@
@can('audit', \App\Models\Asset::class)
<div class="col-md-12" style="padding-top: 5px;">
<a href="{{ route('asset.audit.create', $asset->id) }}" class="btn btn-sm btn-primary btn-block hidden-print{{ (!$asset->model ? ' disabled' : '') }}"{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.model_invalid_fix').'" disabled' : '') !!}">
{{ trans('general.audit') }}
<span class="tooltip-wrapper"{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.model_invalid_fix').'"' : '') !!}>
<a href="{{ route('asset.audit.create', $asset->id) }}" class="btn btn-sm btn-primary btn-block hidden-print{{ (!$asset->model ? ' disabled' : '') }}">
{{ trans('general.audit') }}
</a>
</span>
</div>
@endcan