<?php echo $__env->make('header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<main id="main-content">
    <section class="search-container">
<?php if(!empty($searchEngine['img_HTML'])): ?>
        <figure class="figure-background">
            <?php echo($searchEngine['img_HTML']); ?>        </figure>
<?php endif; ?>
        <div class="search-engine">
            <figure class="figure-background">
                <img
                    src="<?php echo themosis_assets().'/img/search/bg-recherche.svg'; ?>"
                    alt="Search background"
                    data-src="<?php echo themosis_assets().'/img/search/bg-recherche.svg'; ?>"
                    data-minimal="<?php echo themosis_assets().'/img/search/bg-recherche-min.svg'; ?>">
            </figure>
            <div class="search-elements">
                <h1>L'<strong>Agenda</strong> de vos <strong>loisirs</strong> en <strong>Provence</strong></h1>
                <form action="<?php echo($searchEngine['agenda_URL']); ?>" method="get">
                    <select name="date" class="selectpicker" title="Quand ça ?" multiple data-max-options="1">
<?php foreach($searchEngine['when'] as $aDate): ?>
                        <option value="<?php echo($aDate['value']); ?>" <?php echo($aDate['selected']); ?>><?php echo($aDate['label']); ?></option>
<?php endforeach; ?>
                    </select>
                    <select id="type" name="type" class="selectpicker" title="Type d'événement" multiple data-max-options="1">
<?php foreach($searchEngine['what']['type'] as $aType): ?>
                        <option value="<?php echo($aType['value']); ?>" <?php echo($aType['selected']); ?> class="<?php echo($aType['class']); ?>"><?php echo($aType['label']); ?></option>
<?php endforeach; ?>
                    </select>
                    <select id="type_event" name="type_event" class="selectpicker hidden" title="Type d'événement" multiple>
<?php foreach($searchEngine['what']['typeEvent'] as $aType): ?>
                        <option value="<?php echo($aType['value']); ?>" <?php echo($aType['selected']); ?>><?php echo($aType['label']); ?></option>
<?php endforeach; ?>
                    </select>
                    <select id="type_group" name="type_group" class="selectpicker hidden" title="Type d'événement" multiple>
<?php foreach($searchEngine['what']['typeGroup'] as $aType): ?>
                        <option value="<?php echo($aType['value']); ?>" <?php echo($aType['selected']); ?> ><?php echo($aType['label']); ?></option>
<?php endforeach; ?>
                    </select>
                    <select name="city" class="selectpicker" title="Où ça ?" data-live-search="true" multiple data-max-options="1">
<?php foreach($searchEngine['where'] as $aCity): ?>
                        <option value="<?php echo($aCity['value']); ?>"><?php echo($aCity['label']); ?></option>
<?php endforeach; ?>
                    </select>
                    <div class="search-keywords">
                        <input name="keywords" type="text" placeholder="Mots clés">
                    </div>
                    <input type="submit" value="Rechercher">
                </form>
                <div class="advanced-search">
                    <a href="<?php echo($searchEngine['agenda_URL']); ?>">Recherche avancée</a>
                </div>
            </div>
        </div>
    </section>
    <section class="discover-now frieze-separator-purple-top">
        <div class="container">
            <div class="ad-placement ad-banner">
                <?php echo($discoverNow['ad-placement']); ?>            </div>
            <h1 class="leaf-title-blue">à découvrir en ce moment</h1>
            <div class="event-container row">
                <div class="event-small_container js_draggable col-xs-12 col-md-<?php echo($discoverNow['col']); ?>" id="event-small_container">
                    <div class="row">
<?php foreach($discoverNow['events']['small'] as $event): ?>
                        <article class="col-md-<?php echo($discoverNow['col-event']); ?> event-small">
                            <div>
                                <figure>
                                    <a href="<?php echo($event['href']); ?>">
                                        <?php echo($event['img_HTML']); ?>                                    </a>
                                </figure>
                                <div class="event-infos frieze-rounded-white-top">
<?php if(!empty($event['type'])): ?>
                                    <p class="type"><?php echo($event['type']); ?></p>
<?php endif; ?>
                                    <h1><a href="<?php echo($event['href']); ?>"><?php echo($event['title']); ?></a></h1>
<?php if(!empty($event['date'])): ?>
                                    <p class="date"><?php echo($event['date']); ?></p>
<?php endif; ?>
<?php if(!empty($event['category'])): ?>
                                    <p class="category" data-color="<?php echo($event['category']['color']); ?>">
                                        <a href="<?php echo($event['category']['url']); ?>"><?php echo($event['category']['title']); ?></a>
                                    </p>
<?php endif; ?>
<?php if(!empty($event['place']['title'])): ?>
                                    <p class="place">
                                        <a href="<?php echo($event['place']['url']); ?>">
                                            <span class="icon-pictos_localisation"></span>
                                            <?php echo($event['place']['title']); ?>                                        </a>
                                    </p>
<?php endif; ?>
                                </div>
                            </div>
                        </article>
<?php endforeach; ?>
                    </div>
                </div>
<?php if(!empty($discoverNow['events']['big'])): ?>
                <div class="event-big_container col-xs-12 col-md-6">
                    <div class="row">
<?php foreach($discoverNow['events']['big'] as $event): ?>
                        <article class="col-xs-12 event-big">
                            <div>
                                <figure class="figure-background">
                                    <a href="<?php echo($event['href']); ?>">
                                        <?php echo($event['img_HTML']); ?>                                    </a>
                                </figure>
                                <div class="event-infos frieze-rounded-white-top">
<?php if(!empty($event['type'])): ?>
                                    <p class="type"><?php echo($event['type']); ?></p>
<?php endif; ?>
                                    <h1><a href="<?php echo($event['href']); ?>"><?php echo($event['title']); ?></a></h1>
<?php if(!empty($event['date'])): ?>
                                    <p class="date"><?php echo($event['date']); ?></p>
<?php endif; ?>
<?php if(!empty($event['category']['title'])): ?>
                                    <p class="category" data-color="<?php echo($event['category']['color']); ?>">
                                        <a href="<?php echo($event['category']['url']); ?>"><?php echo($event['category']['title']); ?></a>
                                    </p>
<?php endif; ?>
<?php if(!empty($event['place']['title'])): ?>
                                    <p class="place">
                                        <a href="<?php echo($event['place']['url']); ?>">
                                            <span class="icon-pictos_localisation"></span>
                                            <?php echo($event['place']['title']); ?>                                        </a>
                                    </p>
<?php endif; ?>
                                </div>
                            </div>
                        </article>
<?php endforeach; ?>
                    </div>
                </div>
<?php endif; ?>
                <div class="clearfix"></div>
                <div class="all_events">
                    <a href="<?php echo($discoverNow['button_URL']); ?>" type="button">Tous les événements du jour</a>
                </div>
            </div>
        </div>
    </section>
<?php if(!empty($newsSpotlight['ad-placement']['ad'])): ?>
    <section class="ad-placement <?php echo($newsSpotlight['ad-placement']['class']); ?>">
        <div class="container">
            <?php echo($newsSpotlight['ad-placement']['ad']); ?>        </div>
    </section>
<?php endif; ?>
<?php if(!empty($newsSpotlight)): ?>
    <section class="news-spotlight frieze-separator-purple-bottom" data-alternative-frieze="purple-bottom">
<?php if(!empty($newsSpotlight['article']['img_HTML'])): ?>
        <figure>
            <a href="<?php echo($newsSpotlight['article']['href']); ?>"><?php echo($newsSpotlight['article']['img_HTML']); ?></a>
        </figure>
<?php endif; ?>
        <div class="container">
            <div class="content col-sm-8">
                <h1 class="leaf-title-pink">à la une</h1>
                <article class="row">
                    <h1 class="col-md-8"><a href="<?php echo($newsSpotlight['article']['href']); ?>"><?php echo($newsSpotlight['article']['title']); ?></a></h1>
                    <h2><?php echo($newsSpotlight['article']['subtitle']); ?></h2>
                    <p class="article-content col-xs-12"><?php echo($newsSpotlight['article']['excerpt']); ?></p>
                    <div class="article-datas col-xs-12">
<?php if(!empty($newsSpotlight['article']['place']['title'])): ?>
                        <p class="place">
                            <a href="<?php echo($newsSpotlight['article']['place']['url']); ?>">
                                <span class="icon-pictos_localisation"></span>
                                <?php echo($newsSpotlight['article']['place']['title']); ?>                            </a>
                        </p>
<?php endif; ?>
<?php if(!empty($newsSpotlight['article']['heading']['title'])): ?>
                        <p class="rubrique">
                            <a href="<?php echo($newsSpotlight['article']['heading']['url']); ?>">
                                <?php echo($newsSpotlight['article']['heading']['title']); ?>                            </a>
                        </p>
<?php endif; ?>
<?php if(!empty($newsSpotlight['article']['date'])): ?>
                        <p class="date"><?php echo($newsSpotlight['article']['date']); ?></p>
<?php endif; ?>
<?php if(!empty($newsSpotlight['article']['category'])): ?>
                        <p class="category" data-color="<?php echo($newsSpotlight['article']['category']['color']); ?>">
                            <a href="<?php echo($newsSpotlight['article']['category']['url']); ?>"><?php echo($newsSpotlight['article']['category']['title']); ?></a>
                        </p>
<?php endif; ?>
                    </div>
                </article>
            </div>
        </div>
    </section>
<?php endif; ?>
<?php if(!empty($whatsNew)): ?>
    <section class="whats-new">
        <div class="container">
            <h1 class="leaf-title-orange hidden-xs hidden-sm">Quoi de neuf ?</h1>
            <div class="articles-container hidden-xs hidden-sm col-md-8">
                <div>
<?php foreach($whatsNew['articles'] as $aArticle): ?>
                    <article class="row">
                        <figure class="col-sm-3 frieze-rounded-white-right">
                            <a href="<?php echo($aArticle['href']); ?>">
                                <?php echo($aArticle['img_HTML']); ?>                            </a>
                        </figure>
                        <div class="col-sm-9">
                            <h1 class="article-title col-xs-12">
                                <a href="<?php echo($aArticle['href']); ?>"><?php echo($aArticle['title']); ?></a>
                            </h1>
                            <h2><?php echo($aArticle['subtitle']); ?></h2>
                            <p class="article-content col-xs-12"><?php echo($aArticle['excerpt']); ?></p>
                            <div class="article-datas col-xs-12">
<?php if(!empty($aArticle['place']['title'])): ?>
                                <p class="place">
                                    <a href="<?php echo($aArticle['place']['url']); ?>">
                                        <span class="icon-pictos_localisation"></span>
                                        <?php echo($aArticle['place']['title']); ?>                                    </a>
                                </p>
<?php endif; ?>
<?php if(!empty($aArticle['date'])): ?>
                                <p class="date"><?php echo($aArticle['date']); ?></p>
<?php endif; ?>
<?php if(!empty($aArticle['category'])): ?>
                                <p class="category" data-color="<?php echo($aArticle['category']['color']); ?>">
                                    <a href="<?php echo($aArticle['category']['url']); ?>"><?php echo($aArticle['category']['title']); ?></a>
                                </p>
<?php endif; ?>
                            </div>
                        </div>
                    </article>
<?php endforeach; ?>
                </div>
                <div class="all_articles">
                    <a href="<?php echo($whatsNew['button_URL']); ?>" type="button">Toutes les actualités</a>
                </div>
            </div>
<?php if(!empty($whatsNew['ad-placement']['ad'])): ?>
            <div class="ad-placement col-md-4">
                <div class="row">
                    <?php echo($whatsNew['ad-placement']['ad']); ?>                </div>
            </div>
<?php endif; ?>
        </div>
    </section>
<?php endif; ?>
<?php if(!empty($localProducts)): ?>
    <section class="local-products frieze-separator-white-bottom">
        <div class="container">
            <h1 class="leaf-title-green">Ils font vivre le territoire</h1>
            <div class="articles-container row js_draggable" id="articles-container">
<?php foreach($localProducts['articles'] as $aArticle): ?>
                <article class="col-md-4">
                    <div>
                        <figure>
                            <a href="<?php echo($aArticle['href']); ?>">
                                <?php echo($aArticle['img_HTML']); ?>                            </a>
                        </figure>
                        <div class="article-datas frieze-rounded-white-top">
                            <h1><a href="<?php echo($aArticle['href']); ?>"><?php echo($aArticle['title']); ?></a></h1>
                            <h2><?php echo($aArticle['subtitle']); ?></h2>
                            <p class="article-content"><?php echo($aArticle['excerpt']); ?></p>
<?php if(!empty($aArticle['category'])): ?>
                            <p class="category" data-color="<?php echo($aArticle['category']['color']); ?>">
                                <a href="<?php echo($aArticle['category']['url']); ?>"><?php echo($aArticle['category']['title']); ?></a>
                            </p>
<?php endif; ?>
<?php if(!empty($aArticle['place']['title'])): ?>
                            <p class="place">
                                <a href="<?php echo($aArticle['place']['url']); ?>">
                                    <span class="icon-pictos_localisation"></span>
                                    <?php echo($aArticle['place']['title']); ?>                                </a>
                            </p>
<?php endif; ?>
                        </div>
                    </div>
                </article>
<?php endforeach; ?>
            </div>
            <div class="all_articles">
                <a href="<?php echo($localProducts['button_URL']); ?>" type="button">Tous les animateurs de territoire</a>
            </div>
        </div>
    </section>
<?php endif; ?>
</main>

<?php echo $__env->make('footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
