<?php $__env->startSection('content'); ?>
      <form id="home-search" method="POST" action="/search">
        <?php echo csrf_field(); ?>

        <div class="content-options-wrapper">
          <div class="content-options-label hidden-xs">
            <?php echo e(trans('interface.search-all')); ?> <i class="fa fa-angle-down" aria-hidden="true"></i>
          </div>
          <div class="content-options">
            <?php foreach($contentFilters['content'] as $option): ?>
            <?php if($option['value'] != 'all'): ?>
            <div class="checkbox">
              <input id="checkbox-<?php echo e($option['value']); ?>" name="content[]" type="checkbox" value="<?php echo e($option['value']); ?>" <?php if($option['checked']): ?> checked <?php endif; ?>>
              <label for="checkbox-<?php echo e($option['value']); ?>">
                <?php echo e($option['label']); ?>

              </label>
            </div>
            <?php endif; ?>
            <?php endforeach; ?>
          </div>
        </div><div class="search-text-wrapper">
          <i class="fa fa-angle-down visible-xs-inline-block content-option-toggle" aria-hidden="true"></i>
          <input name="search" type="text" name="" placeholder="<?php echo e(trans('interface.search-home')); ?>"><button><i class="fa fa-search" aria-hidden="true"></i></button>
        </div>
      </form>
    <div class="row home-slider">
        <div class="col-md-12 col-xs-12 home-search-wrapper">
        </div>
    </div>
    <?php echo $__env->make('includes.filters', ['hideSearch' => TRUE], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php echo $__env->make('includes.country-filter', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <div class="row count-row hidden-xs">
        <div class="col-md-8">
            <?php echo e(trans('interface.total-results')); ?>

        </div>
        <div class="col-md-4 text-right">
            <?php echo e(trans_choice('interface.count', $news->total())); ?>

        </div>
    </div>

    <?php echo $__env->make('includes.pagination', ['paginator' => $news,'position' => 'top'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

    <div class="row">
        <?php if(count($news) > 0): ?>
            <?php foreach($news as $key => $article): ?>
                <a href="<?php echo e(route('newsdetail', ['id' => $article->id])); ?>" class="col-md-6 col-xs-12 news-link">
                    <div class="news-image-wrapper">
                        <img src="<?php echo e(config('app.assetURL')); ?>/img/news/cover/<?php echo e($article->cover_img); ?>">
                    </div>
                    <div class="news-info">
                        <?php echo e($article->news_date->format('d/m/Y')); ?>

                        -
                        <?php if(isset($article->country) && isset($article->country->country)): ?> <?php echo e(trans('interface.' . strtolower($article->country->country->country))); ?> <?php else: ?> <?php echo e(trans('interface.worldwide')); ?> <?php endif; ?>
                        <?php if(isset($article->season)): ?> - <?php echo e($article->season->prefisso); ?> <?php endif; ?>
                        <?php if(isset($article->year)): ?> <?php echo e($article->year->year); ?> <?php endif; ?>
                    </div>
                    <?php if(App::getLocale() == 'en'): ?>
                        <div class="news-title chronicle">
                            <?php echo e($article->english->title); ?>

                        </div>
                        <div class="news-subtitle chronicle">
                            <?php echo e($article->english->subtitle); ?>

                        </div>
                    <?php else: ?>
                        <div class="news-title chronicle">
                            <?php echo e($article->title); ?>

                        </div>
                        <div class="news-subtitle chronicle">
                            <?php echo e($article->subtitle); ?>

                        </div>
                    <?php endif; ?>
                </a>
                <?php if((($key + 1) % 2) === 0): ?>
                    <div class="clearfix hidden-xs" style="margin-bottom: 1.5em;"></div>
                <?php endif; ?>
            <?php endforeach; ?>


        <?php else: ?>
            <div class="col-md-12 text-center">
                <?php echo e(trans('interface.empty-list')); ?>

            </div>
        <?php endif; ?>
    </div>

    <?php echo $__env->make('includes.pagination', ['paginator' => $news,'position' => 'bottom'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php echo $__env->make('includes.video-wrapper', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script type="text/javascript">
        var images = [
            <?php foreach($images as $image): ?>
                "<?php echo e(config('app.assetURL')); ?>/<?php echo e($image->img); ?>",
            <?php endforeach; ?>
        ];
        var running = false;
        $(document).ready(function() {
            $(window).trigger('resize');
        });
        $(window).resize(function(){
            // media query
            if ($(window).width() > 768){
                // run through the array forever
                if(running == false) {
                    (function recurse(counter) {
                        // get the colour
                        var image = images[counter];
                        // animate it
                        $('.home-search-wrapper').css('background-image', 'URL(' + image + ')');
                        // delete the value to save memory
                        delete images[counter];
                        // add the value at the end of the array
                        images.push(image);
                        // run it again for the next number
                        setTimeout(function() {
                            recurse(counter + 1);
                        }, 8000);
                    // start it for the first number.
                    })(0);
                    running = true;
                }
            }
        });
    </script>
<?php $__env->stopSection(); ?>

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