ldc-boutique-cnc/resources/views/bo/slides/index.blade.php
2021-04-14 17:33:55 +02:00

69 lines
3.3 KiB
PHP

@extends('layouts.bo-layout')
@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><img src="{{ asset('/images/slides/' . $slide->picture) }}" height="50px"></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', ['id' => $slide->id, 'action' => 'down'])}}" class="btn-link text-decoration-none">
<i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down fa-2x"></i>
</a>
@elseif($loop->last)
<a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'up'])}}" class="btn-link text-decoration-none">
<i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up fa-2x"></i>
</a>
@else
<a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'up'])}}" class="btn-link text-decoration-none">
<i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up fa-2x"></i>
</a>
<a href="{{route('bo.slides.change-order', ['id' => $slide->id, 'action' => 'down'])}}" class="btn-link text-decoration-none">
<i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down fa-2x"></i>
</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