<!-- Card -->
<div class="card mt-5">
    <!-- Header -->
    <div class="card-header">
        <h4 class="card-header-title">Media</h4>
    </div>
    <!-- End Header -->

    <!-- Body -->
    <div class="card-body">
        <!-- File Attachment Input -->
        <label class="custom-file-boxed" for="customFileInputBoxedEg">
            <span id="customFileBoxedEg">Seleccionar archivos</span>
            <small class="d-block text-muted">Uno o más</small>

            <input id="customFileInputBoxedEg" name="images[]" type="file" class="js-file-attach custom-file-boxed-input"
                   data-hs-file-attach-options='{
             "textTarget": "#customFileBoxedEg"
           }' multiple>
        </label>
        <!-- End File Attachment Input -->

        <div class="media-cards row sortable" data-href="<?php echo e(route('backend.posts.order')); ?>">
            <?php $__currentLoopData = $model->post->media->sortBy('post.order'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $medium): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-lg-4 col-sm-6 mt-3" id="post_<?php echo e($medium->post->id); ?>">
                    <div class="card card-form"data-action="<?php echo e(route('backend.media.update', $medium->id)); ?>">
                        <img class="card-img-top" src="<?php echo e(asset($medium->thumbnail)); ?>" alt="Card image cap">
                        <div class="card-body">
                            <?php if($medium->post->title): ?>
                                <h3 class="card-title"><?php echo e($medium->post->title); ?></h3>
                            <?php endif; ?>
                            <?php if($medium->post->excerpt): ?>
                                <p class="card-text"><?php echo nl2br($medium->post->excerpt); ?></p>
                            <?php endif; ?>
                            <div class="form-group">
                                <a class="btn btn-outline-primary btn-sm handle">
                                    <i class="tio-move-page" style="color: inherit;"></i>
                                </a>
                                <a class="btn btn-outline-success btn-sm handle" href="<?php echo e(route('backend.media.edit', $medium->id)); ?>">
                                    <i class="tio-pen" style="color: inherit;"></i> Editar
                                </a>
                                <a class="modal-toggle-delete btn btn-outline-danger btn-sm" href="#" data-href="<?php echo e(route('backend.media.destroy', $medium->id)); ?>">
                                    <i class="tio-delete-outlined" style="color: inherit;"></i> Eliminar
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
    <!-- Body -->
</div>
<!-- End Card -->

<?php $__env->startPush('scripts'); ?>
    <!-- Modal -->
    <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <?php echo Form::open([
                    'method' => 'delete'
                ]); ?>

                <div class="modal-header">
                    <h5 class="modal-title" id="deleteModalLabel">Eliminar imagen</h5>
                    <button type="button" class="btn btn-xs btn-icon btn-ghost-secondary" data-dismiss="modal" aria-label="Close">
                        <i class="tio-clear tio-lg"></i>
                    </button>
                </div>
                <div class="modal-body">
                    <span></span>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">Cancelar</button>
                    <button class="btn btn-danger" type="submit">Eliminar</button>
                </div>
                <?php echo Form::close(); ?>

            </div>
        </div>
    </div>
    <!-- End Modal -->
    <script>
      $(function() {
        $('.modal-toggle-delete').on('click', function() {
          $('#deleteModal form').attr('action', $(this).attr('data-href'));
          $('#deleteModal .modal-body span').text($(this).attr('data-title'));
          $('#deleteModal').modal('show');
          return false;
        });
      });
    </script>
<?php $__env->stopPush(); ?><?php /**PATH /Users/helder/Localhost/k/bgreen/resources/views/backend/partials/images.blade.php ENDPATH**/ ?>