ldc-com-app-bo/resources/views/document/index.blade.php
2022-05-11 12:36:27 +02:00

62 lines
2.5 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12 d-flex justify-content-end">
<a href="{{ route('documents.create') }}" class="btn btn-sm btn-primary">{{ __('Ajouter') }}</a>
</div>
</div>
<br>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">{{ __('Titre') }}</th>
<th scope="col">{{ __('Type') }}</th>
<th scope="col">{{ __('Dossier') }}</th>
<th scope="col">{{ __('Langue') }}</th>
<th scope="col">{{ __('Publié') }} ?</th>
</tr>
</thead>
<tbody>
@foreach($documents as $document)
<tr>
<th scope="row"><a href="{{ route('documents.edit', ['document' => $document]) }}">{{$document->title}}</a></th>
<td>{{$document->type}}</td>
<td>
@foreach($document->parents as $parent)
{{ json_decode($parent->name)->fr }} @if(!$loop->last) \ @endif
@endforeach
</td>
<td>{{strtoupper($document->lang)}}</td>
<td>
@if ($document->published === 1)
{{ __('Oui') }}
@else
{{ __('Non') }}
@endif
</td>
</tr>
@foreach($document->others_lang as $doc)
<tr>
<th scope="row"><a href="{{ route('documents.edit', ['document' => $doc]) }}">--- {{$doc->title}}</a></th>
<td>{{$doc->type}}</td>
<td>
@foreach($doc->parents as $parent)
{{ json_decode($parent->name)->fr }} @if(!$loop->last) \ @endif
@endforeach
</td>
<td>{{strtoupper($doc->lang)}}</td>
<td>
@if ($document->published === 1)
{{ __('Oui') }}
@else
{{ __('Non') }}
@endif
</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div>
@endsection