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

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

View file

@ -867,7 +867,7 @@
'id' => 'bulkForm']) }} 'id' => 'bulkForm']) }}
<input type="hidden" name="bulk_actions" value="labels" /> <input type="hidden" name="bulk_actions" value="labels" />
<input type="hidden" name="ids[{{$asset->id}}]" value="{{ $asset->id }}" /> <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() }} {{ Form::close() }}
@ -895,17 +895,21 @@
@if (($asset->assigned_to != '') && ($asset->deleted_at=='')) @if (($asset->assigned_to != '') && ($asset->deleted_at==''))
@can('checkin', \App\Models\Asset::class) @can('checkin', \App\Models\Asset::class)
<div class="col-md-12"> <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') }} {{ trans('admin/hardware/general.checkin') }}
</a> </a>
</span>
</div> </div>
@endcan @endcan
@elseif (($asset->assigned_to == '') && ($asset->deleted_at=='')) @elseif (($asset->assigned_to == '') && ($asset->deleted_at==''))
@can('checkout', \App\Models\Asset::class) @can('checkout', \App\Models\Asset::class)
<div class="col-md-12" style="padding-top: 5px;"> <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') }} {{ trans('admin/hardware/general.checkout') }}
</a> </a>
</span>
</div> </div>
@endcan @endcan
@endif @endif
@ -932,9 +936,11 @@
@can('audit', \App\Models\Asset::class) @can('audit', \App\Models\Asset::class)
<div class="col-md-12" style="padding-top: 5px;"> <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' : '') !!}"> <span class="tooltip-wrapper"{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.model_invalid_fix').'"' : '') !!}>
{{ trans('general.audit') }} <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> </a>
</span>
</div> </div>
@endcan @endcan