<?php $__env->startSection('title', $medium->exists ? 'Editando '.$medium->post->title : 'Crear nueva imagen'); ?>

<?php $__env->startSection('content'); ?>
    <!-- Page Header -->
    <div class="page-header">
        <div class="row align-items-center">
            <div class="col-sm mb-2 mb-sm-0">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb breadcrumb-no-gutter">
                        <li class="breadcrumb-item"><a class="breadcrumb-link" href="javascript:;">Contenido</a></li>
                        <?php if($medium->page): ?>
                            <li class="breadcrumb-item"><a class="breadcrumb-link" href="<?php echo e(route('backend.pages.edit', $medium->page->id)); ?>"><?php echo e($medium->page->post->title); ?></a></li>
                        <?php endif; ?>
                        <?php if($medium->product): ?>
                            <li class="breadcrumb-item"><a class="breadcrumb-link" href="<?php echo e(route('backend.products.edit', $medium->product->id)); ?>"><?php echo e($medium->product->post->title); ?></a></li>
                        <?php endif; ?>
                        <?php if($medium->section): ?>
                            <li class="breadcrumb-item"><a class="breadcrumb-link" href="<?php echo e(route('backend.sections.edit', $medium->section->id)); ?>"><?php echo e($medium->section->post->title); ?></a></li>
                        <?php endif; ?>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo $__env->yieldContent('title'); ?></li>
                    </ol>
                </nav>

                <h1 class="page-header-title"><?php echo $__env->yieldContent('title'); ?></h1>
            </div>
        </div>
        <!-- End Row -->
    </div>
    <!-- End Page Header -->

    <?php echo Form::model($medium, [
        'method' => $medium->exists ? 'put' : 'post',
        'route' => $medium->exists ? ['backend.media.update', $medium->id] : 'backend.media.store',
        'files' => true
    ]); ?>

    <div class="row">
        <div class="col-lg-8">

            <!-- Card -->
            <div class="card mb-3 mb-lg-5">
                <!-- Header -->
                <div class="card-header">
                    <h4 class="card-header-title">Información de imagen</h4>
                </div>
                <!-- End Header -->

                <!-- Body -->
                <div class="card-body">
                    <!-- Form Group -->
                    <div class="form-group">
                        <label for="sectionNameLabel" class="input-label">Nombre</label>
                        <?php echo Form::text('post[title]', null, ['class' => 'form-control', 'id' => 'sectionNameLabel']); ?>

                    </div>
                    <!-- End Form Group -->

                

                
                
                
                
                
                

                <!-- Form Group -->
                    <div class="form-group">
                        <label for="textLabel" class="input-label">Texto</label>

                        <?php echo Form::textarea('post[excerpt]', null, ['class' => 'form-control', 'id' => 'textLabel', 'rows' => 5]); ?>

                    </div>
                    <!-- End Form Group -->

                <!-- Form Group -->
                    <div class="form-group">
                        <label for="contentLabel" class="input-label">Contenido</label>

                        <?php echo Form::textarea('post[content]', null, ['class' => 'form-control ckeditor', 'id' => 'contentLabel', 'rows' => 5]); ?>

                    </div>
                    <!-- End Form Group -->

                    <!-- Form Group -->
                    <div class="form-group">
                        <label for="urlLabel" class="input-label">Enlace</label>

                        <?php echo Form::text('url', null, ['class' => 'form-control', 'id' => 'urlLabel']); ?>

                    </div>
                    <!-- End Form Group -->
                </div>
                <!-- Body -->
            </div>
            <!-- End Card -->
        </div>

        <div class="col-lg-4">

            <div class="card mb-3 mb-lg-5">
                <!-- Header -->
                <div class="card-header">
                    <h4 class="card-header-title">Vista previa</h4>
                </div>
                <!-- End Header -->

                <!-- Body -->
                <div class="card-body">
                    <img class="card-img-top" src="<?php echo e(asset($medium->thumbnail)); ?>" alt="Card image cap">
                </div>
                <!-- Body -->
            </div>
            <!-- End Card -->

            <!-- Card -->
            <div class="card mb-3 mb-lg-5">
                <!-- Header -->
                <div class="card-header">
                    <h4 class="card-header-title">Visibilidad</h4>
                </div>
                <!-- End Header -->

                <!-- Body -->
                <div class="card-body">
                    <!-- Toggle Switch -->
                    <label class="row toggle-switch" for="featuredSwitch1">
                          <span class="col-8 col-sm-9 toggle-switch-content ml-0">
                            <span class="text-dark">Destacado</span>
                          </span>
                        <span class="col-4 col-sm-3">
                            <?php echo Form::hidden('post[featured]', 0); ?>

                            <?php echo Form::checkbox('post[featured]', 1, $medium->exists ? $medium->post->featured : 1, ['class' => 'toggle-switch-input', 'id' => 'featuredSwitch1']); ?>

                            <span class="toggle-switch-label ml-auto">
                              <span class="toggle-switch-indicator"></span>
                            </span>
                          </span>
                    </label>
                    <!-- End Toggle Switch -->
                    <!-- Toggle Switch -->
                    <label class="row toggle-switch mt-3" for="activeSwitch1">
                          <span class="col-8 col-sm-9 toggle-switch-content ml-0">
                            <span class="text-dark">Activo</span>
                          </span>
                        <span class="col-4 col-sm-3">
                            <?php echo Form::hidden('post[active]', 0); ?>

                            <?php echo Form::checkbox('post[active]', 1, $medium->exists ? $medium->post->active : 1, ['class' => 'toggle-switch-input', 'id' => 'activeSwitch1']); ?>

                            <span class="toggle-switch-label ml-auto">
                              <span class="toggle-switch-indicator"></span>
                            </span>
                          </span>
                    </label>
                    <!-- End Toggle Switch -->
                </div>
                <!-- Body -->
            </div>
            <!-- End Card -->

            <div class="card">
                <div class="card-body d-sm-flex align-items-sm-center">
                    <button type="submit" class="btn btn-primary btn-block"><?php echo e($medium->exists ? 'Actualizar' : 'Crear'); ?> imagen</button>
                </div>
            </div>
        </div>
    </div>
    <!-- End Row -->
    <?php echo Form::close(); ?>

<?php $__env->stopSection(); ?>

<?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>
    <script>
      $(function() {
        // INITIALIZATION OF ADD INPUT FILED
        // =======================================================
        $('.js-add-field').each(function () {
          new HSAddField($(this), {
            addedField: function() {
              $('.js-add-field .js-select2-custom-dynamic').each(function () {
                var select2dynamic = $.HSCore.components.HSSelect2.init($(this));
              });
            }
          }).init();
        });


        // INITIALIZATION OF TAGIFY
        // =======================================================
        $('.js-tagify').each(function () {
          var tagify = $.HSCore.components.HSTagify.init($(this), {
            originalInputValueFormat: valuesArr => valuesArr.map(item => item.value).join(',')
          });
        });


        // INITIALIZATION OF DROPZONE FILE ATTACH MODULE
        // =======================================================
        $('.js-dropzone').each(function () {
          var dropzone = $.HSCore.components.HSDropzone.init('#' + $(this).attr('id'));
        });
      });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.backend', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/poshcom/bgreen.posh.com.py/resources/views/backend/media/form.blade.php ENDPATH**/ ?>