<?php echo $__env->make('layouts.commons.success', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('layouts.commons.errors', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?php if(Auth::user()->can('edit_projet') && $editable): ?>
    <div class="row mt-2 mb-2">
        <div class="col-12">
            <a href="<?php echo e(route('fichiers.create', $projet->id)); ?>" class="btn btn-outline-success float-right">Ajouter un fichier</a>
        </div>
    </div>
<?php endif; ?>

<?php if($projet->fichiers->count() > 0): ?>
    <table class="table table-striped table-bordered">
        <thead>
            <th>Fichier</th>
            <th>Déposé par</th>
            <th>Commentaire</th>
            <th>Dates</th>
            <?php if(Auth::user()->can('edit_projet') && $editable): ?>
                <th>Actions</th>
            <?php endif; ?>
        </thead>
        <tbody>
            <?php $__currentLoopData = $projet->fichiers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $fichier): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td>
                        <a href="<?php echo e(route('fichiers.download', [$projet->id, $fichier->id])); ?>"><?php echo e($fichier->nom); ?></a>
                    </td>
                    <td><?php echo e($fichier->user->nom_complet()); ?></td>
                    <td><?php echo e($fichier->commentaire ?? '-'); ?></td>
                    <td>
                        Ajouté le <?php echo e(date('d/m/Y', strtotime($fichier->created_at))); ?><br>
                        Modifié le <?php echo e(date('d/m/Y', strtotime($fichier->updated_at))); ?>

                    </td>
                    <?php if(Auth::user()->can('edit_projet') && $editable): ?>
                        <td style="width: 12%">
                            <a class="btn btn-outline-primary" href="<?php echo e(route('fichiers.edit', [$projet->id, $fichier->id])); ?>"
                                data-toggle="tooltip" data-placement="top" title="Editer">
                                <i class="fas fa-pencil-alt"></i>
                            </a>
                            <form class="inline-form-table" action="<?php echo e(route('fichiers.destroy', [$projet->id, $fichier->id])); ?>" method="POST">
                                <?php echo csrf_field(); ?>
                                <?php echo e(method_field('DELETE')); ?>

                                <button type="submit" class="btn btn-outline-danger"
                                    data-toggle="tooltip" data-placement="top" title="Supprimer">
                                    <i class="fas fa-trash-alt"></i>
                                </button>
                            </form>
                        </td>
                    <?php endif; ?>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>
<?php else: ?>
    <div class="pt-2">
        <h4>Pas de données disponible.</h4>
    </div>
<?php endif; ?>
<?php /**PATH /var/www/html/resources/views/projets/form/onglets/fichiers/index.blade.php ENDPATH**/ ?>