ldc-cocotte/resources/views/bo/faqs/index-list.blade.php
Jérémy Munsch c52b13cc51
feat(order): implement soft delete handling in order changes
Added support for soft-deleted models in ChangeModelOrder and ChangeModelOrderPosition actions.
This allows for proper order adjustments even when models are soft-deleted.
2026-10-29 19:04:46 +01:00

53 lines
1.9 KiB
PHP

<div class="table-responsive">
<table class="fix-action table">
<thead>
<tr class="visually-hidden">
<th scope="col"></th>
</tr>
@php
$cols = [
'question' => Str::ucfirst(__('validation.custom.attributes.question')),
'order' => Str::ucfirst(__('validation.custom.attributes.order')),
];
@endphp
@include('bo.modules.tableColSorter', ['cols' => $cols, 'mobileHide' => ['description']])
</thead>
<tbody>
@forelse ($faqs as $faq)
<tr>
<td>{{ Str::limit($faq->question, 40) }}</td>
@include('bo.modules.change-order', [
'route' => 'bo.faqs.change-order',
'model' => $faq,
'first' => $loop->first,
'last' => $loop->last,
'isFirstPage' => $faqs->onFirstPage(),
'isLastPage' => !$faqs->hasMorePages(),
])
<td>
<div class="btn-group">
@can('update', $faq)
<a class="btn btn-sm btn-primary" href="{{ route('bo.faqs.edit', $faq) }}"
title="{{ Str::ucfirst(__('crud.actions.update')) }}"><i class="fa-solid fa-pen"></i></a>
@endcan
@can('delete', $faq)
<form class="d-inline confirmDeleteJS" action="{{ route('bo.faqs.destroy', $faq) }}" method="POST">
@method('DELETE')
@csrf
<button class="btn btn-sm btn-danger rounded-start-0" title="{{ Str::ucfirst(__('crud.actions.delete')) }}"><i
class="fa-solid fa-trash"></i></button>
</form>
@endcan
</div>
</td>
</tr>
@empty
<tr>
<td class="text-center" colspan="20">
<span class="h3">{{ __('crud.helpers.no_results') }}</span>
</td>
</tr>
@endforelse
</tbody>
</table>
</div>