ldc-legaulois/resources/views/bo/articles/index.blade.php
2021-04-28 13:57:12 +02:00

43 lines
1.6 KiB
PHP

@extends('layouts.bo')
@section('content')
<div class="card">
<div class="card-header">
Liste des articles
<a href="{{route('bo.articles.create')}}" class="btn btn-sm btn-primary float-right">Ajouter</a>
</div>
<div class="card-body">
{{ $articles->withQueryString()->links() }}
<table class="table text-center">
<thead class="thead-dark">
<tr>
<th scope="col">Titre</th>
<th scope="col">Catégorie</th>
<th scope="col">Publié ?</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach($articles as $article)
<tr>
<th>{{$article->title}}</th>
<td>{{$article->type->label}}</td>
<td>
<a href="{{route('bo.articles.change-published', $article)}}" class="btn-link">
@if ($article->status)
<i class="fas fa-check check-green"></i>
@else
<i class="fas fa-times cross-red"></i>
@endif
</a>
</td>
<td><a href="{{route('bo.articles.edit', $article->id)}}" class="btn btn-sm btn-primary">Éditer</a></td>
</tr>
@endforeach
</tbody>
</table>
{{ $articles->withQueryString()->links() }}
</div>
</div>
@endsection