ldc-volena/resources/views/bo/pages/sections/index-list.blade.php

52 lines
2.6 KiB
PHP

<table class="table-hover table-fix-action m-0 table">
@if (count($sectionModelList) > 0)
<thead>
@include('bo.modules.table-col-sorter', [
'cols' => array_merge(
!request()->related_page ? ['page_id' => Str::ucfirst(trans_choice('models.classes.static_page', 1))] : [],
[
'section' => Str::ucfirst(trans_choice('models.classes.section', 1)),
'h2_title' => Str::ucfirst(__('validation.custom.h2_title')),
'updated_at' => Str::ucfirst(__('validation.attributes.updated_at')),
]),
])
</thead>
<tbody>
@foreach ($sectionModelList as $sectionModel)
<tr class="border-bottom">
@if (!request()->related_page)
<td class="text-center align-middle">{{ $sectionModel->page->title }}</td>
@endif
<td class="text-center align-middle">{{ $sectionModel->section->label() }}</td>
<td class="text-center align-middle">{{ $sectionModel->h2_title }}</td>
<td class="text-center align-middle">
<span class="badge bg-secondary">{{ $sectionModel->updated_at->isoFormat('LLLL') }}</span>
</td>
<td class="text-end align-middle">
@canAny(['update'], $sectionModel)
<div class="btn-group">
@can('update', $sectionModel)
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
href="{{ route('bo.sections.edit', ['section' => $sectionModel]) }}"
title="{{ Str::ucfirst(__('crud.actions.update')) }}">
<i class="fa-solid fa-pencil"></i>
</a>
@endcan
</div>
@else
<span class="text-danger" data-bs-toggle="tooltip" title="{{ __('list.right') }}">
<i class="fa-solid fa-ban"></i>
</span>
@endcan
</td>
</tr>
@endforeach
</tbody>
@else
<tr>
<td class="border-0">
{{ trans_choice('crud.other.no_model_found', 1, ['model' => trans_choice('models.classes.section', 1)]) }}
</td>
</tr>
@endif
</table>