templates/front/Recherche/liste.html.twig line 1

Open in your IDE?
  1. {% set count = 0 %}
  2. {# 
  3.     Itération sur tous les hébergements remontés
  4. #}
  5. {% for reponse in reponses %}
  6.     {% set affproduit = 1 %}
  7.     
  8.     {% set duree = reponse.Duree|default(3) %}
  9.     {% set tomorrow = date().modify('+1 day') %}
  10.     {% set datearrivee = reponse.DateDebut|default(tomorrow|date('d/m/Y')) %}
  11.     {% set nbadultes = nbadultes|default(1) %}
  12.     {% set nbenfants = nbenfants|default(0) %}
  13.     
  14.     
  15.     {% set numHebergement = loop.index0 %}
  16.     {% if affproduit == 1 %}
  17.         {% if count % 3 == 0 %}
  18.             <div class="clear">
  19.         {% endif %}
  20.         {% set slug = reponse.nom |replace({"*": " "})|slugify %}
  21.         
  22.         <div class=" col-md-4 col-sm-6 col-xs-12 promo lienHebergement{{ reponse.IdLieuHebergement }}">
  23.             {% if page_code is defined and page_code == "theme" %}
  24.                 <a href="{{ path('ac_platform_produit', {'slug': slug, 'id': reponse.IdLieuHebergement, 'datearrivee': reponse.DateDebut, 'duree': reponse.Duree }) }}" >
  25.             {% else %}
  26.                 <a href="{{ path('ac_platform_produit', {'slug': slug, 'id': reponse.IdLieuHebergement, 'datearrivee': datearrivee, 'duree': duree, 'nbadultes': nbadultes, 'nbenfants': nbenfants }) }}" >
  27.             {% endif %}
  28.             <div class="productItem col-md-12 col-sm-12 col-xs-12 block-list-blanc padding-off">
  29.                 <div class="col-md-12 padding-top-10 header-liste-resultat">
  30.                     <span class="h3">
  31.                         {{ reponse.res_lieu |raw }}
  32.                     </span>
  33.                     <div class="ville-plus-type">
  34.                         <span class="ville">{{ reponse.nom |replace({"*": " <i class='glyphicon glyphicon-star star'></i>"}) |raw }}</span>
  35.                         {#<span class="dot">.</span>#}
  36.                         {#{% if mod is defined and mod == "destination" %}#}
  37.                         {% if mod is defined and mod == "destination" %}
  38.                             {% set travellers = app.session.get('travellers') %}
  39.                             {% if travellers is not null %}
  40.                                 {% set affdatedebut = travellers['actdatearrivee'] %}
  41.                                 {% set affdatefin = travellers['actdatedepart'] %}
  42.                             
  43.                                 {% if datearrivee |date("d/m/Y") != affdatedebut %}
  44.                                     {% set affdatedebut = datearrivee |date("d/m/Y") %}
  45.                                     {% set affdatefin = datearrivee |date_modify("+" ~ duree ~ " day") |date("d/m/Y") %}
  46.                                 {% endif %}
  47.                                 
  48.                                 {#<span class="domaine">{{ hebergement.ListFiches.zero.nom |replace({"*": ""}) |raw }}</span>#}
  49.                                 {% if aff_date %}
  50.                                 <span class="date">{{ 'du' |trans({}, 'global') |capitalize }} {{ affdatedebut }} {{ 'au' |trans({}, 'global') }} {{ affdatefin }}</span>
  51.                                 {% endif %}
  52.                             {% endif %}
  53.                         {% else %}
  54.                             <span class="dot">.</span>
  55.                             <span class="typo"> {{ reponse.famille |raw }}</span>
  56.                             {% if mod is defined and mod == "promo" and deboffre is defined %}
  57.                                 {% if aff_date %}
  58.                                     <span class="date">{{ 'du' |trans({}, 'global') |capitalize }} {{ deboffre }} {{ 'au' |trans({}, 'global') }} {{ finoffre }}</span>
  59.                                 {% endif %}
  60.                             {% endif %}
  61.                         {% endif %}
  62.                     </div>
  63.                 </div>
  64.                 
  65.                 <div class="col-md-12 padding-off">
  66.                     {% if photoProfil[count] is defined  %}
  67.                         <img src="{{  photoProfil[count] }}" alt="{{ reponse.nom }}" />
  68.                     {% endif %}
  69.                 </div>
  70.                 
  71.                 {% if reponse.res_shortdesc is not empty %}
  72.                     <div class="col-md-12">
  73.                         <div class="short-desc" style="float:left">
  74.                             <span>{{ reponse.res_shortdesc|striptags |truncate(230)|default("")  |raw }}</span>
  75.                         </div>
  76.                     </div>
  77.                 {% endif %}
  78.                 <div class="col-md-12 col-sm-12 col-xs-12 picto-presta-height">
  79.                 
  80.                     {% if reponse.presta_inc | length > 0 %}
  81.                        
  82.                         {% set filteredPresta = reponse.presta_inc|filter(tpresta => tpresta == 1) %}
  83.                         {% for key, tpresta in filteredPresta %}
  84.                             {% if loop.index < 11 %}
  85.                                 {% set pr = key|replace({'presta_inc_': ''}) %}
  86.                                 <abbr title="{{ pr|trans({}, 'presta')|raw }}" rel="tooltip">
  87.                                     <div class="{{ pr }}-b"></div>
  88.                                 </abbr>
  89.                             {% endif %}
  90.                         {% endfor %}
  91.                     {% endif %}
  92.                 </div>
  93.                 <!-- Séparateur -->
  94.                 <div class="col-md-12 col-sm-12 col-xs-12 liste-resultat">
  95.                     <div class="col-md-12 col-sm-12 col-xs-12 fiche-filet2"></div>
  96.                 </div>
  97.                 <!-- -->
  98.                 <div class="footer-liste-resultat">
  99.                     <div class="col-md-7 col-sm-7 col-xs-12 block-prix block-prix-liste">
  100.                         
  101.                         {% if mod is not defined or mod != 'promo' %}
  102.                             {#{% set nb = 0 %}#}
  103.                              
  104.                             {% set tprixtotal = null %}
  105.                             
  106.                              {% set tprixtotal = reponse.PrixTotal %}
  107.                             
  108.                             {% set ispromo = false %}
  109.                             {% set var_test = 'TEST' %}
  110.                             {% if reponse.MontantTauxPromo > 0 %}
  111.                                 {% set ispromo = true %}
  112.                             {% endif %}
  113.                             {% set cssprix = "prix" %}
  114.                             {% include "/front/Produit/tarif.html.twig" with {'reponse': reponse, 'ispromo': ispromo, 'duree': duree } %}
  115.                             
  116.                         {% endif %}
  117.                     </div>
  118.                     <div class="col-md-5 col-sm-5 col-xs-12 pull-right text-right">
  119.                         {% if page_code is defined and page_code == "theme" %}
  120.                             <span class="btn-ateya width-100 page_code_theme">
  121.                         {% else %}
  122.                             <span class="btn-ateya width-100 page_code_destination">
  123.                         {% endif %}
  124.                             {% if btname is defined %}
  125.                                     {{ ('ancre.' ~ btname) |trans({},'app') |raw }}
  126.                             {% else %}
  127.                                 {{ 'ancre.reserver' |trans({},'app') |raw }}
  128.                             {% endif %}
  129.                         </span>
  130.                     </div>
  131.                 </div>
  132.             </div></a>
  133.         {% if count % 3 == 2 %}
  134.         </div>
  135.         {% endif %}
  136.         {% set count = count + 1 %}
  137.         </div>
  138.     {% endif %}
  139.     
  140.     
  141. {% endfor %}