<?php $__env->startSection('page-title', $category->category); ?>

<?php $__env->startSection('content'); ?>
<h1 class="headerSection"><?php echo e($category->category); ?></h1>


<?php if(Auth::user()): ?>

<div class="fixed-action-btn toolbar">
  <span class="new badge blue badgeButtom" style="float:left;"> Agregar</span>
  <a class="btn-floating btn-large blue z-depth-4">
    <i class="large material-icons">library_add</i> 
  </a>
  <ul>
    <li class="waves-effect waves-light">
        <a href="<?php echo e(url('create')); ?>"><i class="fa fa-list-alt"></i> Crear nuevo Contenido</a>
    </li> 
  </ul>
</div>
<?php endif; ?>

    <?php if(count($contents)): ?>
        <?php foreach($contents as $content): ?>

            <div class="row">
              <div class="col s12 m6">
                <?php if(Auth::user()): ?>
                  <?php if($content->status == 1): ?>
                    <div class="card">
                  <?php else: ?>
                    <div class="card" style="opacity: 0.5;">                       
                  <?php endif; ?>
                 <?php else: ?>
                 <div class="card"> 
                 <?php endif; ?>
                  <div class="card-image">
                    <?php if($content->images==''): ?>                      
                      <img src="https://dummyimage.com/600x250/000/c8f7ea&text=Sin-Imagen" />
                    <?php else: ?>
                      <img  class="materialboxed" data-caption="<?php echo e($content->title); ?>" src="<?php echo e(asset('assets/img/optimized/image-'.$content->images)); ?>">
                    <?php endif; ?>
                    <span class="card-title titlePrimary">
                        <a class="titleHref" href="<?php echo e(url($category->slug.'/blog/'.$content->slug)); ?>">
                            <?php echo e($content->title); ?> 
                        </a>
                      <?php if(Auth::user()): ?>
                        <?php if($content->status == 1): ?>
                          <span class="btn btn-success"> <i class="fa fa-eye"></i> Contenido Publicado</span>
                        <?php else: ?>
                          <span class="btn btn-danger" style="opacity:1"> <i class="fa fa-eye-slash"></i> Contenido Despublicado</span>                          
                        <?php endif; ?>
                      <?php endif; ?>
                    </span>
                    
                    <a class="btn-floating halfway-fab waves-effect waves-light orangeTI pulse z-depth-4" onclick="location.href='<?php echo e(url($category->slug.'/blog/'.$content->slug)); ?>'">
                        <i class="fa fa-eye"></i>  
                    </a>
                  </div>
                  <div class="card-content">
                    <blockquote>
                        <div class="text-right timeDescription">
                            <?php 
                               echo "<span class='new badge'>".\Carbon\Carbon::now()->subMinutes( \Carbon\Carbon::now()->diffInMinutes( \Carbon\Carbon::parse($content->publish_up)))->diffForHumans()."</span> <i class='fa fa-calendar' aria-hidden='true'></i> ".date('d M Y',strtotime($content->publish_up));
                             ?>
                        </div>
                        <p class="text-justify descriptionText"><?php echo e(substr(strip_tags($content->description),0,300)); ?>... <span class="new badge badgeButtom">  <a class="titleHref" href="<?php echo e(url($category->slug.'/blog/'.$content->slug)); ?>">Leer más...</a></span></p>
                        <p class="text-right">
                            <i class="fa fa-user"></i> <small>Escrito por:</small> <?php if($content->created_by_alias): ?> <?php echo e($content->created_by_alias); ?> <?php else: ?> <?php echo e($content->author); ?> <?php endif; ?>
                        </p>
                    </blockquote>
                  </div>
                </div>
              </div>
            </div>

          <hr>
        <?php endforeach; ?>
    <?php else: ?>
       <?php echo $__env->make('partials.noData', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php endif; ?>
    <?php  $paginates=$contents;  ?>
    <?php echo $__env->make('partials.paginate', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

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

<?php $__env->startSection('scripts'); ?>
    <script type="text/javascript">
        $(document).ready(function(){
          $('.parallax').parallax();
        });
    </script>
<?php $__env->stopSection(); ?>

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