ldc-legaulois/resources/views/bo/modules/change-model-order.blade.php
2026-10-02 10:52:29 +02:00

59 lines
2.5 KiB
PHP

@php
$forPictos = $forPictos ?? false;
@endphp
<td class="text-center align-middle">
@can('changeOrder', $model)
<div class="d-flex justify-content-center align-items-center">
<form @if($forPictos) data-change-order-picto @endif @class([
'invisible' =>
$loop->first and
(method_exists($models, 'onFirstPage')
? $models->onFirstPage()
: $loop->first),
])
action="{{ route('bo.' . $routeName . '.change-order', [str($routeName)->singular()->value => $model, 'direction' => 'up']) }}"
method="POST">
@csrf
@method('PATCH')
<button data-bs-toggle="tooltip" type="submit" title="{{ __('crud.other.up') }}" @class([
'btn btn-sm btn-outline-secondary',
'disabled' =>
$loop->first and
(method_exists($models, 'onFirstPage')
? $models->onFirstPage()
: $loop->first),
])>
<i class="fas fa-arrow-up"></i>
</button>
</form>
<form @if($forPictos) data-change-order-picto @endif @class([
'invisible' =>
$loop->last and
(method_exists($models, 'lastPage')
? $models->currentPage() === $models->lastPage()
: $loop->last),
])
action="{{ route('bo.' . $routeName . '.change-order', [str($routeName)->singular()->value => $model, 'direction' => 'down']) }}"
method="POST">
@csrf
@method('PATCH')
<button data-bs-toggle="tooltip" type="submit" title="{{ __('crud.other.down') }}"
@class([
'btn btn-sm btn-outline-secondary ms-1',
'disabled' =>
$loop->last and
(method_exists($models, 'lastPage')
? $models->currentPage() === $models->lastPage()
: $loop->last),
])>
<i class="fas fa-arrow-down"></i>
</button>
</form>
</div>
@else
<span class="text-danger" data-bs-toggle="tooltip" title="{{ __('crud.other.right') }}">
<i class="fa-solid fa-ban"></i>
</span>
@endcan
</td>