<?php $__env->startSection('page-title', trans('app.activities')); ?>
 
<?php $__env->startSection('content'); ?>

<div class="stricky-header stricked-menu main-menu">
    <div class="sticky-header__content"></div><!-- /.sticky-header__content -->
</div><!-- /.stricky-header -->

<section class="page-header">
  <div class="page-header__bg" style="background-image: url(<?php echo e(asset('assets/images/header.jpg')); ?>);"></div>
  <div class="container">
    <h2>Editor de Contenido </h2>
    <ul class="thm-breadcrumb list-unstyled">
        <li class="text-white"><a href="<?php echo e(url('/')); ?>">Inicio</a></li>
    </ul>
  </div>
</section>

<div class="container bootstrap-iso" style="left: 40; padding:2em;">
    <?php echo Form::open(['route' => 'content.store', 'files' => true, 'id' => 'user-form']); ?>

    <?php echo e(Form::hidden('id', $content->id)); ?>

    <?php $nameInput='category_id'; $nameObj='Categoría de Contenido'; ?>
    <div class="form-group col-xs-12 list-group-item <?php if($errors->first($nameInput)): ?> has-error <?php endif; ?>  ">
      <?php echo e(Form::label($nameInput, $nameObj,['class'=>'control-label'])); ?>

      <?php echo e(Form::select($nameInput,(['' => '---Seleccionar Opción---'] + $categories),$content->category_id,['id'=>$nameInput,'class' => 'form-control'])); ?>

      <?php if($errors->first($nameInput)): ?><div class="new badge red""><?php echo e($errors->first($nameInput)); ?> </div><?php endif; ?>
    </div>

    <?php $nameInput='publish_up'; $nameObj='Fecha de Publicación'; ?>
    <div class="form-group col-xs-12 list-group-item <?php if($errors->first($nameInput)): ?> has-error <?php endif; ?>  ">
      <?php echo e(Form::label($nameInput, $nameObj,['class'=>'control-label datepicker','data-provide'=>'datepicker'])); ?>

      <?php echo e(Form::text($nameInput, $content->publish_up, ['id'=>$nameInput,'placeholder'=>$nameObj,'class'=>'form-control datepicker'])); ?>

      <?php if($errors->first($nameInput)): ?><div class="new badge red""><?php echo e($errors->first($nameInput)); ?> </div><?php endif; ?>
    </div>

    <?php $nameInput='title'; $nameObj='Título'; ?>
    <div class="form-group col-xs-12 list-group-item <?php if($errors->first($nameInput)): ?> has-error <?php endif; ?>  ">
      <?php echo e(Form::label($nameInput, $nameObj,['class'=>'control-label'])); ?>

      <?php echo e(Form::text($nameInput, $content->title, ['id'=>$nameInput,'placeholder'=>$nameObj,'class'=>'form-control'])); ?>

      <?php if($errors->first($nameInput)): ?><div class="new badge red""><?php echo e($errors->first($nameInput)); ?> </div><?php endif; ?>
    </div>

    <?php $nameInput='created_by_alias'; $nameObj='Autor'; ?>
    <div class="form-group col-xs-12 list-group-item <?php if($errors->first($nameInput)): ?> has-error <?php endif; ?>  ">
      <?php echo e(Form::label($nameInput, $nameObj,['class'=>'control-label'])); ?>

      <?php echo e(Form::text($nameInput, $content->created_by_alias, ['id'=>$nameInput,'placeholder'=>$nameObj,'class'=>'form-control'])); ?>

      <?php if($errors->first($nameInput)): ?><div class="new badge red""><?php echo e($errors->first($nameInput)); ?> </div><?php endif; ?>
    </div>

    <?php $nameInput='description'; $nameObj='Descripción'; ?>
    <div class="form-group col-xs-12 list-group-item <?php if($errors->first($nameInput)): ?> has-error <?php endif; ?>  ">
      <?php echo e(Form::label($nameInput, $nameObj,['class'=>'control-label'])); ?>

      <?php echo e(Form::textarea($nameInput, $content->description, ['id'=>$nameInput,'placeholder'=>$nameObj,'class'=>'form-control file-path validate'])); ?>

      <?php if($errors->first($nameInput)): ?><div class="new badge red""><?php echo e($errors->first($nameInput)); ?> </div><?php endif; ?>
    </div>

    <div class="col-xs-12">
      <div class="card-panel grey lighten-5 z-depth-1">
        <div class="row valign-wrapper">
          <div class="col s2">
            <img src="<?php echo e(asset('assets/img/original/'.$content->images)); ?>"alt="" class="rounded mx-auto d-block " width="50%;"> <!-- notice the "circle" class -->
          </div>
          <div class="col s10">
            <span class="black-text">
              <div class="badge green"><strong>Imagen Atual</strong></div>
              <div><strong>Creado el:</strong> <?php echo e($content->created_at); ?></div>
              <div><strong>Última modificacion:</strong> <?php echo e($content->updated_at); ?></div>
            </span>
          </div>
        </div>
      </div>
    </div>

    <?php $nameInput='images'; $nameObj='Reemplazar Imagen Principal'; ?>
    <?php /* <div class="form-group col-xs-12 list-group-item  <?php if($errors->first($nameInput)): ?> has-error <?php endif; ?>  ">
        <div class="file-field input-field">
                <?php echo e(Form::label($nameInput, $nameObj,['class'=>'control-label'])); ?>

                <input type="file" name="images" value="">
        </div>
    </div> */ ?>

    <?php $nameInput='images'; $nameObj='Reemplazar Imagen Principal'; ?>
    <div class="form-group col-xs-12 list-group-item file-field input-field <?php if($errors->first($nameInput)): ?> has-error <?php endif; ?>  ">
      <div class="file-field input-field">
        <div class="btn">
          <span><?php echo e($nameObj); ?></span>
          <?php echo e(Form::file($nameInput , ['id'=>$nameInput,'placeholder'=>$nameObj,'class'=>'form-control'])); ?>

        </div>
        <div class="file-path-wrapper">
          <input class="file-path validate" type="text" placeholder="Seleccionar imagen">
        </div>
      </div>
      <?php if($errors->first($nameInput)): ?><div class="new badge red""><?php echo e($errors->first($nameInput)); ?> </div><?php endif; ?>
    </div>

  <div class="row">
    <?php $nameInput='featured'; $nameObj='Destacado'; ?>
    <div class="form-group col-xs-12 col-md-6 list-group-item <?php if($errors->first($nameInput)): ?> has-error <?php endif; ?>  ">
      <div class="switch">
        <label>
          Sin Destacar
          <?php if($content->featured == 1): ?>
              <input type="checkbox" name="featured" id="featured" checked>
          <?php elseif($content->featured == 0): ?>
              <input type="checkbox" name="featured" id="featured">
          <?php endif; ?>
          <span class="lever"></span>
          Destacado
        </label>
      </div>
    </div>
  </div>

  <?php /* <div class="form-group">
    <label for="title">Título</label>
    <input type="text" class="form-control" id="title" name="title" aria-describedby="emailHelp" value="<?php echo e($content->title); ?>">
    <small id="emailHelp" class="form-text text-muted"></small>
  </div> */ ?>

  <hr>
  <div class="row">
    <div class="col-xs-12 col-md-6">
      <a class="btn btn-outline-danger btn-lg btn-block waves-effect waves-light" href="<?php echo e(url('/')); ?>">
        <i class="fa fa-close"></i> Cancelar
      </a>
    </div>
    <div class="col-xs-12 col-md-6">
      <button type="submit" class="btn btn-primary btn-lg btn-block waves-effect waves-light">
        <i class="fa fa-save"></i> Guardar Datos
      </button>
    </div>
  </div>
  <hr>
    <?php echo Form::close(); ?>

</div>

<?php echo $__env->make('partials.modal', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

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

<?php $__env->startSection('scripts'); ?>

    <?php echo $__env->make('partials.tinymce', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php echo $__env->make('partials.scripts', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
     
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.web', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>