<?php $__env->startSection('page-title'); ?> <?php echo e($content->title); ?> <?php $__env->stopSection(); ?>
<?php $__env->startSection('meta'); ?>
    <meta property="og:url"                content="<?php echo e(url($category->slug.'/blog/'.$content->slug)); ?>" />
    <meta property="og:type"               content="article" />
    <meta property="og:title"              content="<?php echo e($content->title); ?>" />
    <meta property="og:image"              content="<?php echo e(asset('assets/img/optimized/image-'.$content->images)); ?>" /> 
    <meta property="og:description"        content="<?php echo e(strip_tags(substr($content->description, 0, 150))); ?>..." />
	<meta property="fb:app_id" content="116494819024922" />
	<meta property="article:author" content="268002723664026" />
	<meta property="article:publisher" content="140826800272366402653947357" /> 
  
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<h1 class="headerSection"><?php echo e($content->title); ?> <br> <small><?php echo e($category->category); ?></small></h1>

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

<div class="fixed-action-btn toolbar">
  <span class="new badge red badgeButtom" style="float:left;"> Modificar</span>
  <a class="btn-floating btn-large red z-depth-4">
    <i class="large material-icons">mode_edit</i>
  </a>
  <ul>
    <li class="waves-effect waves-light">
        <a href="<?php echo e(url('contenido/'.$category->slug.'/editar/'.$content->id)); ?>"><i class="fa fa-pencil-square-o"></i> Editar</a>
    </li>
    <?php if($content->status==1): ?>
        <li class="waves-effect waves-light">
            <a href="<?php echo e(url('contenido/'.$category->slug.'/status/'.$content->id)); ?>"><i class="fa fa-eye-slash"></i> Despublicar</a>
        </li>
    <?php else: ?>
        <li class="waves-effect waves-light">
            <a href="<?php echo e(url('contenido/'.$category->slug.'/status/'.$content->id)); ?>"></i> Publicar</a>
        </li>
    <?php endif; ?> 
    <li class="waves-effect waves-light" style="display:yes">
            <a href="<?php echo e(url('contenido/eliminar', $content->id )); ?>"><i class="fa fa-trash"></i>Eliminar</a>
            
    </li>
    <li class="waves-effect waves-light">
        <a href="<?php echo e(route('archivos.edit',$content->slug)); ?>"><i class="fa fa-picture-o"></i> Adjuntar Archivo</a>
    </li>
  </ul>
</div>
<?php endif; ?>

    <?php if(count($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">
                    <img  class="materialboxed" data-caption="<?php echo e($content->title); ?>" src="<?php echo e(asset('assets/img/optimized/image-'.$content->images)); ?>">
                    <span class="card-title titlePrimary">
                        <small class="text-left">
                            <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; ?>
                      <?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; ?>                        
                        </small>
                    </span>
                  </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> 
                        <?php echo $content->description; ?>


                    </blockquote>

                    
                    <ul class="collapsible popout" data-collapsible="accordion">
                        
                    <?php if($files->first()): ?> 
                      <li>
                        <div class="collapsible-header"><i class="fa fa-file-text"></i>Documentos <span class="new badge"><?php echo e($files->count()); ?> Archivos</span></div>
                        <div class="collapsible-body">
                            <div class="collection">
                                <?php foreach($files as $file): ?>
                                    <a href="<?php echo e(asset('assets/files/'.$file->file)); ?>" target="_new" class="collection-item">
                                        <i class="fa fa-file-text-o"></i> <?php echo e($file->name); ?>

                                        <div class="badge">
                                            <i class="fa fa-cloud-download fa-2x" ></i>
                                        </div>
                                    </a>
                                <?php endforeach; ?>
                            </div>
                        </div>
                      </li>
                    <?php else: ?>
                        _
                    <?php endif; ?>
                    <?php if($images->first()): ?> 
                      <li>
                        <div class="collapsible-header"><i class="fa fa-picture-o"></i>Imágenes <span class="new badge"><?php echo e($images->count()); ?> Elementos</span></div>
                        <div class="collapsible-body">
                            <?php /* <span><?php echo e($images); ?></span> */ ?>
                            <div class="caroussel">
                                <div class="slider">
                                    <ul class="slides">      
                                      <?php foreach($images as $image): ?>
                                      <li>
                                        <img src="<?php echo e(asset('assets/img/optimized/image-'.$image->file)); ?>" alt="<?php echo e($image->name); ?>" class="materialboxed">
                                        <img src="http://lorempixel.com/580/250/nature/1"> <!-- random image -->
                                        <div class="caption center-align">
                                          <h3><?php echo e($image->title); ?></h3>
                                          <h5 class="light grey-text text-lighten-3"><?php echo e($image->description); ?></h5>
                                          <?php if(Auth::user()): ?>
                                              <span class="new badge red">
                                                  <a href="" class="titleHref"><i class="fa fa-close"></i> Eliminar imagen</a>
                                              </span>
                                          <?php endif; ?>
                                        </div>
                                        </li>
                                       <?php endforeach; ?> 
                                    </ul>
                                </div>
                            </div>
                        </div>
                      </li>
                    <?php endif; ?>  
                    </ul>

                    <div class="text-right">
                        <a target="_new" href="https://wa.me/?text=Hola!, quiero compartirte: <?php echo e(url($category->slug.'/blog/'.$content->slug)); ?>" class="whatsapp"><i class="fa fa-whatsapp" aria-hidden="true"></i> Compartir por WhatsApp</a>

  <div class="fb-like" data-href="<?php echo e(url($category->slug.'/blog/'.$content->slug)); ?>" data-width="500" data-layout="button" data-action="like" data-size="large" data-show-faces="true" data-share="true">Me Gusta </div>  
 

                        <div class="fb-comments" data-href="<?php echo e(url($category->slug.'/blog/'.$content->slug)); ?>" data-numposts="5"></div>
                    </div>

                  </div>
                </div>
              </div>
            </div>

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

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

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

    </script> 

 <?php echo $__env->make('partials.share', 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(); ?>