{% if destinations is defined %}
{% if type == "select" %}
<select class="selectpicker recherche-lieu radius-none" name="destination" multiple data-max-options="1" title="{{ 'menu.recherche.ou_aller' |trans({},'app') |raw }}">
<option class="ville" value="2" selected> {{ "menu.recherche.n_importe_ou" |trans({},'app') |raw }}</option>
{% for pays in destinations %}
{% for type in pays.children %}
{% if type.children is not null %}
<optgroup label="" data-max-options="1">
<option value="{{ type.id_iresa }}" {% if id == type.id_iresa %}selected{% endif %}>{{ type.name }}</option>
{% for gregion in type.children %}
{% if gregion.children is not null %}
{% for region in gregion.children %}
{% if region.children is not null %}
<option class="region" value="{{ region.id_iresa }}" {% if id == region.id_iresa %}selected{% endif %}> {{ region.name }}</option>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</optgroup>
{% endif %}
{% endfor %}
{% endfor %}
</select>
{% else %}
{% set nestedMenu = '' %}
{% for pays in destinations %}
<ul id="menu-destinations" class="sub-menu sub-menu-1 menu-destination">
<li class="col-md-12 col-sm-12 col-xs-12 mega-menu">
<div class="grid-container">
<div class="column left-column hidden-xs">
<ul>
{% for type in pays.children %}
{% if type.children is not null %}
<li>
<a class="destination-type" data-menu="{{ type.name }}" href="{{ path('ac_platform_destination', {'slug': type.name|slugify, 'id': type.id_iresa }) }}">
{{ type.name }}
</a>
{% set nestedMenu = nestedMenu ~ '<div class="nested-menu" id="menu-' ~ type.name ~ '">' %}
{% for gregion in type.children %}
{% if gregion.children is not null %}
{% for region in gregion.children %}
{% if region.children is not null %}
{% set link = '<a href="' ~ path('ac_platform_destination', {'slug': region.name|slugify, 'id': region.id_iresa }) ~'" class="link">' ~ region.name ~ '</a>' %}
{% set nestedMenu = nestedMenu ~ link %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% set nestedMenu = nestedMenu ~ '</div>' %}
</li>
{% endif %}
{% endfor %}
{# lien By Ateya #}
<li>
<a class="destination-type" data-menu="byateya" href="{{ path('ac_platform_theme', {'slug': 'residences-by-ateya', 'id': 32, 'duree': 7 }) }}">
<em>by ATEYA</em>
</a>
{%
set byAteyaResidences = '<a href="' ~ path('ac_platform_produit', {'slug': 'le-domaine-des-cazelles-by-ateya' , 'id': 111}) ~'" class="link">Le Domaine des Cazelles<br/><small>Cajarc / Cahors</small></a>
<a href="' ~ path('ac_platform_produit', {'slug': 'le-hameau-des-sources-by-ateya' , 'id': 286}) ~'" class="link">Le Hameau des Sources<br/><small>Montbrun les Bains</small></a>
<a href="' ~ path('ac_platform_produit', {'slug': 'le-domaine-du-golf-by-ateya' , 'id': 2}) ~'" class="link">Le Domaine du Golf<br/><small>Fabrègues / Montpellier</small></a>
<a href="' ~ path('ac_platform_produit', {'slug': 'le-claux-du-puits-by-ateya' , 'id': 37}) ~'" class="link">Le Claux du Puits<br/><small>Saint-Trinit / Pays de Sault</small></a>
<a href="' ~ path('ac_platform_produit', {'slug': 'maison-au-golf-de-la-cabre-d-or-by-ateya' , 'id': 166}) ~'" class="link">Maison au Golf de la Cabre d\'Or<br/><small>Cabriès / Aix-en-Provence</small></a>'
%}
{% set nestedMenu = nestedMenu ~ '<div class="nested-menu" id="menu-byateya">' ~ byAteyaResidences ~'</div>' %}
</li>
</ul>
</div>
<div class="column full-column visible-xs-block">
<ul>
{% for type in pays.children %}
{% if type.children is not null %}
<li>
<a class="sub-menu-btn" data-menu="{{ type.name }}" data-level="2" href="#">
{{ type.name }}
<span class="iconDir glyphicon glyphicon-menu-right visible-xs-block"></span>
</a>
<div id="menu-{{ type.name }}-mobile" class="sub-menu sub-menu-2 nested-menu-mobile">
{% for gregion in type.children %}
{% if gregion.children is not null %}
{% for region in gregion.children %}
{% if region.children is not null %}
<a href="{{ path('ac_platform_destination', {'slug': region.name|slugify, 'id': region.id_iresa }) }}" class="link">{{ region.name }}</a>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</div>
</li>
{% endif %}
{% endfor %}
{# lien By Ateya #}
<li>
<a class="sub-menu-btn" data-menu="byateya" data-level="2" href="#">
<em>by ATEYA</em>
<span class="iconDir glyphicon glyphicon-menu-right visible-xs-block"></span>
</a>
<div id="menu-byateya-mobile" class="sub-menu sub-menu-2 nested-menu-mobile">
{{ byAteyaResidences | raw }}
</div>
</li>
</ul>
</div>
<div class="column center-column hidden-xs"></div>
<div class="column right-column hidden-xs">
{{ nestedMenu | raw }}
</div>
</div>
</li>
</ul>
{% endfor %}
{% endif %}
{% endif %}