ldc-doux/resources/views/back/slides/index.blade.php
2022-01-22 16:57:39 +01:00

68 lines
3.1 KiB
PHP

@extends('layouts.backend')
@section('content')
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">{{ __('Slides') }} <small class="text-muted">{{ __('Liste') }}</small></h1>
@if ($errors->any())
@foreach($errors->all() as $error)
<span class="float-center text-danger">{{ $error }}</span>
@endforeach
@endif
<a href="{{route('bo.slides.create')}}" class="btn btn-primary float-right">{{ __('Créer un slide') }}</a>
</div>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">{{ __('Titre') }}</th>
<th scope="col">{{ __('Texte') }}</th>
<th scope="col">{{ __('Image') }}</th>
<th scope="col">{{ __('Lien') }}</th>
<th scope="col">{{ __('Début') }}</th>
<th scope="col">{{ __('Fin') }}</th>
<th scope="col">{{ __('Slider de regroupement') }}</th>
<th scope="col">{{ __('Ordre') }}</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach($slides as $slide)
<tr>
<td>{{$slide->title}}</td>
<td>{!! $slide->text !!}</td>
<td>@if (!empty($slide->picture))<img src="{{ asset($slide->picture) }}" height="50px">@endif</td>
<td><a href="{{$slide->link}}" target="_slide">{{ $slide->link_label }}</a></td>
<td>{{$slide->date_start}}</td>
<td>{{$slide->date_end}}</td>
<td><a href="{{route('bo.sliders.edit', $slide->slider->id) }}">{{$slide->slider->label}}</a></td>
<td>
@if ($loop->first)
<a href="{{route('bo.slides.change-order', ['slide' => $slide->id, 'action' => 'down'])}}" class="btn-link text-decoration-none">
>
</a>
@elseif($loop->last)
<a href="{{route('bo.slides.change-order', ['slide' => $slide->id, 'action' => 'up'])}}" class="btn-link text-decoration-none">
<
</a>
@else
<a href="{{route('bo.slides.change-order', ['slide' => $slide->id, 'action' => 'up'])}}" class="btn-link text-decoration-none">
<
</a>
<a href="{{route('bo.slides.change-order', ['slide' => $slide->id, 'action' => 'down'])}}" class="btn-link text-decoration-none">
>
</a>
@endif
</td>
<td>
<a href="{{route('bo.slides.edit', ['slide' => $slide->id])}}" class="btn btn-sm btn-primary">{{ __('Éditer') }}</a>
<form action="{{route('bo.slides.destroy', $slide->id)}}" method="POST" class="d-inline">
@method('DELETE')
@csrf
<input type="submit" class="btn btn-sm btn-danger" value="Supprimer" onclick="return confirm('Êtes-vous sûr(e) ?')">
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
@endsection