ldc-agis/resources/views/bo/pages/homepages/index-list.blade.php
Nicolas Demangeat e1994588e1 added homepage
2023-10-23 10:42:57 +02:00

62 lines
3.5 KiB
PHP

<table class="table-hover table-fix-action m-0 table">
@if (count($homepageModels) > 0)
<thead>
@include('bo.modules.table-col-sorter', [
'cols' => [
'title_part1' => Str::ucfirst(__('validation.custom.title_part1')),
'title_part2' => Str::ucfirst(__('validation.custom.title_part2')),
'title_part3' => Str::ucfirst(__('validation.custom.title_part3')),
'picture' => Str::ucfirst(__('validation.custom.picture')),
'presentation_title' => Str::ucfirst(__('validation.custom.presentation_title')),
'presentation_content' => Str::ucfirst(__('validation.attributes.content')),
'updated_at' => Str::ucfirst(__('validation.attributes.updated_at')),
],
])
</thead>
<tbody>
@foreach ($homepageModels as $homepageModel)
<tr class="border-bottom list-item">
<td class="text-center align-middle">{{ $homepageModel->title_part1 }}</td>
<td class="text-center align-middle">{{ $homepageModel->title_part2 }}</td>
<td class="text-center align-middle">{{ $homepageModel->title_part3 }}</td>
<td class="text-center align-middle">
<img src="{{ asset($homepageModel->picture) }}" title="{{ $homepageModel->picture_title }}"
alt="{{ $homepageModel->picture_alt }}" height="50px">
</td>
<td class="text-center align-middle">{{ $homepageModel->presentation_title }}</td>
<td class="text-center align-middle">{!! Str::limit($homepageModel->presentation_content, 100) !!}</td>
<td class="text-center align-middle">
<span class="badge bg-secondary">{{ $homepageModel->updated_at->isoFormat('LLLL') }}</span>
</td>
@php
$routeName = request()
->route()
->getName();
@endphp
<td class="text-end align-middle">
@canAny(['update'], $homepageModel)
<form class="btn-group confirmDeleteTS" action="{{ route('bo.homepages.edit', $homepageModel) }}" method="POST"
novalidate>
@can('update', $homepageModel)
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
href="{{ route('bo.homepages.edit', ['homepage' => $homepageModel]) }}"
title="{{ Str::ucfirst(__('crud.actions.update')) }}">
<i class="fa-solid fa-pencil"></i>
</a>
@endcan
</form>
@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">{{ __('crud.other.no_model_found', ['model' => __('models.classes.homepage')]) }}</td>
</tr>
@endif
</table>