

<?php $__env->startSection('title', isset($page_article) ? $page_article : __('backend.article')); ?>

<?php 
	use Carbon\Carbon;
 ?>

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


  <div class="container-fluid">

		<div class="row">
  		<div class="col-xs-12">
				<section id="message-banner" class="panel panel-primary">
				<header class="panel-heading">
						<h2>
							<?php echo e(isset($page_article) ? $page_article : __('backend.article')); ?>

						</h2>
					</header>
				<div class="panel-body">
					
					<div class="table-responsive">

		    			<table class="table table-hover article" id="table-dt">
					    <thead>
						    <tr>
						    	<th class="text-center">#</th>
						      <th class="text-center" style="width: 160px;"><?php echo app('translator')->getFromJson('backend.banner'); ?></th>
						      <th class="text-center"><?php echo app('translator')->getFromJson('backend.title'); ?></th>
					        <th class="text-center" style="min-width: 65px;"><?php echo app('translator')->getFromJson('backend.action'); ?></th>
						    </tr>
					    </thead>
					    <tbody>
					    	<?php $__currentLoopData = $articles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $article): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
					    		<tr>
					    			<td><?php echo e($loop->iteration); ?></td>
					    			<td>
					    				<img src="<?php echo e(asset($storage_url.'img/article/'.$article->banner)); ?>" alt="" class="img-responsive thumb">
					    			</td>
					    			<td>
											<div class="wrapper">
												<h5><?php echo e($article->title); ?></h5>
												<ul class="tag-wrapper">
													<?php $__currentLoopData = $article->tags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
														<li class="tag"><?php echo e($tag->name); ?></li>
													<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
												</ul>
												<p class="publisher">Created <?php echo e(Carbon::createFromTimestamp(strtotime($article->created_at))->diffForHumans()); ?> by <?php echo e($article->user->name); ?></p>
											</div>
					    			</td>
					    			<td>
					    				<a href="<?php echo e(route('articles.featured', $article)); ?>" class="btn <?php echo e($article->featured ? 'btn-warning' : 'btn-default'); ?>">
					    					<i class="fa fa-star fa-fw"></i>
					    				</a>
					    				<?php if($article->published==true): ?>
					    					<a href="<?php echo e(route('articles.hide', $article)); ?>" class="btn btn-default">
						    					<i class="fa fa-check"></i>
						    				</a>
					    				<?php else: ?>
				    						<a href="<?php echo e(route('articles.publish', $article)); ?>" class="btn btn-default">
						    					<i class="fa fa-square-o"></i>
						    				</a>
					    				<?php endif; ?>
					    				<a href="<?php echo e(route('articles.edit', $article)); ?>" class="btn btn-default">
					    					<i class="fa fa-pencil"></i>
					    				</a>
					    				<a href="<?php echo e(route('articles.delete', $article)); ?>" class="btn btn-danger">
					    					<i class="fa fa-trash"></i>
					    				</a>
					    			</td>
					    		</tr>
					    	<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

					    </tbody>
						</table>

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

			</div>
		</div>

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

<?php $__env->startSection('script'); ?>
	<script>
		$("#table-dt").DataTable();
	</script>
<?php $__env->stopSection(); ?>

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