ldc-doux/resources/views/back/gammes/index.blade.php
2022-01-23 15:03:05 +01:00

53 lines
2.2 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">{{ __('Gammes') }} <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.gammes.create')}}" class="btn btn-primary float-right">{{ __('Créer une gamme') }}</a>
</div>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">{{ __('Nom') }}</th>
<th scope="col">{{ __('Texte') }}</th>
<th scope="col">{{ __('Vignette') }}</th>
<th scope="col">{{ __('Couleur') }}</th>
<th scope="col">{{ __('Gamme parente') }}</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach($gammes as $gamme)
<tr>
@if ($gamme->parent_gamme_id)
<td>- {{$gamme->title}}</td>
@else
<td>{{$gamme->title}}</td>
@endif
<td>{{$gamme->text}}</td>
<td>@if (!empty($gamme->picture))<img src="{{ asset($gamme->picture) }}" height="50px">@endif</td>
<td><input type="color" class="form-control form-control-color" id="exampleColorInput" value="{{$gamme->color}}" disabled></td>
<td>
@if (isset($gamme->parentGamme))
<a href="{{route('bo.gammes.edit', $gamme->parentGamme->id) }}">{{$gamme->parentGamme->title}}</a>
@endif
</td>
<td>
<a href="{{route('bo.gammes.edit', ['gamme' => $gamme->id])}}" class="btn btn-sm btn-primary">{{ __('Éditer') }}</a>
<form action="{{route('bo.gammes.destroy', $gamme->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