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

68 lines
3.3 KiB
PHP

@extends('layouts.bo')
@section('content')
<div class="card">
<div class="card-header">
Liste des contenus - {{ $type->label }}
<a href="{{route('bo.ocb.create')}}" class="btn btn-sm btn-primary float-right">Ajouter</a>
</div>
<div class="card-body">
{{ $contenu->withQueryString()->links() }}
<table class="table text-center">
<thead class="thead-dark">
<tr>
<th scope="col">Visuel</th>
<th scope="col">Extrait</th>
<th scope="col">Publié ?</th>
<th scope="col">Ordre</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach($contenu as $ocb)
<tr>
<th><img src="{{ asset($ocb->picture) }}" style="max-height: 50px;"></th>
<td class="w-50">
@if (strlen(strip_tags($ocb->content)) > 100)
{!! substr(strip_tags($ocb->content), 0, 100) !!}
@else
{!! strip_tags($ocb->content) !!}
@endif
</td>
<td style="width: 15%;">
<a href="{{route('bo.ocb.change-published', $ocb)}}" class="btn-link">
@if ($ocb->status)
<i class="fas fa-check check-green"></i>
@else
<i class="fas fa-times cross-red"></i>
@endif
</a>
</td>
<td>
@if ($loop->first)
<a href="{{route('bo.ocb.change-order', ['current' => $ocb->id, 'action' => 'down'])}}" class="btn-link text-decoration-none">
<i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down"></i>
</a>
@elseif($loop->last)
<a href="{{route('bo.ocb.change-order', ['current' => $ocb, 'action' => 'up'])}}" class="btn-link text-decoration-none">
<i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up"></i>
</a>
@else(int)
<a href="{{route('bo.ocb.change-order', ['current' => $ocb, 'action' => 'down'])}}" class="btn-link text-decoration-none">
<i name="down_arrow" class="icon-size far fa-arrow-alt-circle-down"></i>
</a>
<a href="{{route('bo.ocb.change-order', ['current' => $ocb->id, 'action' => 'up'])}}" class="btn-link text-decoration-none">
<i name="up_arrow" class="icon-size far fa-arrow-alt-circle-up"></i>
</a>
@endif
</td>
<td><a href="{{route('bo.ocb.edit', $ocb->id)}}" class="btn btn-sm btn-primary">Éditer</a></td>
</tr>
@endforeach
</tbody>
</table>
{{ $contenu->withQueryString()->links() }}
</div>
</div>
@endsection