{% extends default_layout is defined ? default_layout : "AyalineEzMiniSitesCollectivitesBundle::pagelayout.html.twig" %}
{% block file_ariane %}
{% endblock %}
 {% block content %}
     {# Bloc Actualités #}
     {% block actualites_home %}
         <div id="bloc-actualites-2" class="bloc-actualites-2 bloc-actualites-2-v2">
             <div class="container">
                 <h2 class="h2-home-theme">
                     {% if content is defined and content.fields.actualites_titre is defined and content.getField('actualites_titre').value is not null %}
                         {{ ez_render_field(content, 'actualites_titre') }}
                     {% endif %}
                 </h2>
                 <div class="row">

                     {{ render( controller(
                         "AyalineEzActualitesCollectivitesBundle:NewsRoot:embedNews",
                         {
                             'rootID' : content.contentInfo.mainLocationId,
                             'template': 'AyalineEzMiniSitesCollectivitesBundle::home/actualites_mini_site.html.twig',
                             'limit': 4,
                             'racine_actualite_id': location_id_by_content_id(content.getField('actualites_racine').value.destinationContentId)
                         }
                     )
                     ) }}
                 </div>
                 {% if content is defined and content.fields.actualites_racine is defined and content.getField('actualites_racine').value.destinationContentId is not null %}
                     {% set targetActuLocationId = location_id_by_content_id(content.getField('actualites_racine').value.destinationContentId) %}
                     {% if targetActuLocationId %}
                         <a href="{{ path( 'ez_urlalias', {'locationId': targetActuLocationId  } ) }}"
                            class="voir-plus"
                            title="{{ ez_field_value(content, 'actualites_titre_lien')|raw }}">{{ ez_field_value(content, 'actualites_titre_lien')|raw }}</a>
                     {% endif %}
                 {% endif %}
             </div>
         </div>
     {% endblock %}
     {# Fin bloc Actualités #}

     {% block grille %}
         {{ render(controller("AyalineEzMiniSitesCollectivitesBundle:Home:getBlocHome", {'type': 'bloc_accueil_mini_sites_racine', 'template': 'AyalineEzMiniSitesCollectivitesBundle:home:bloc_home.html.twig','contentParentId':'accueil_mini_site'})) }}
     {% endblock %}

     {% if configurationGenerale.fields.afficher_rs_newsletter is defined and not ez_is_field_empty( configurationGenerale, 'afficher_rs_newsletter' ) %}
         <div class="bloc-contact">
             <div class="container">
                 {% block reseaux_sociaux %}
                     <div class="bloc-rs-footer col-md-6">
                         <h2 class="h2-home-theme">Suivez-nous</h2>
                         {{ render (controller("AyalineCollectiviteBundle:PageLayout:getSocialNetworks")) }}
                     </div>
                 {% endblock %}
                 {% block contact %}
                     <div class="bloc-newsletter col-md-6">
                         {% if content.fields.formulaire_contact is defined and not ez_is_field_empty(content, "formulaire_contact") %}
                             <a href="{{ path( 'ez_urlalias', {'locationId': location_id_by_content_id(content.getField('formulaire_contact').value.destinationContentId)  } ) }}" class="contact-link h3-theme-2">Contactez-nous</a>
                         {% endif %}

                         {% if configurationGenerale is defined and configurationGenerale.fields.newsletter_lettres is defined and not ez_is_field_empty( configurationGenerale, "newsletter_lettres" ) %}
                             <h3 class="h3-theme-2">Lettre d'information</h3>

                             <div class="newsletter-form">
                                 {{ render (controller("AyalineCollectiviteBundle:PageLayout:newsletter")) }}
                             </div>
                         {% endif %}
                     </div>
                 {% endblock %}
             </div>
         </div>
     {% endif %}

 {% endblock content %}