42 lines
1.8 KiB
PHP
42 lines
1.8 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">Gammes de produits <small class="text-muted">Liste</small></h1>
|
|
<!-- TODO : Tester quand il y aura des produits la suppression d'une gamme qui en a -->
|
|
@if ($errors->any())
|
|
@foreach($errors->all() as $error)
|
|
<span class="float-center text-danger">{{ $error }}</span>
|
|
@endforeach
|
|
@endif
|
|
<a href="{{route('bo.ranges.create')}}" class="btn btn-primary float-right">Ajouter</a>
|
|
</div>
|
|
<table class="table">
|
|
<thead>
|
|
<th scope="col">Image</th>
|
|
<th scope="col">Nom</th>
|
|
<th scope="col">Slug</th>
|
|
<th></th>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($ranges as $range)
|
|
<tr>
|
|
<td>@if ($range->picture !== null)<img src="/images/gammes/{{$range->picture}}" alt="{{$range->name}}" style="max-height: 100px;">@endif</td>
|
|
<td>{{$range->name}}</td>
|
|
<td>{{$range->slug}}</td>
|
|
<td class="text-center">
|
|
<a href="{{route('bo.ranges.edit', $range->id)}}" class="btn btn-sm btn-primary">Éditer</a>
|
|
<form action="{{route('bo.ranges.destroy', $range->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
|
|
|