templates/main/site/views/Partials/Homepage/homepageTestimonials.html.twig line 1

Open in your IDE?
  1. {% trans_default_domain 'Site' %}
  2. {% from ('main/site/views/Partials/icon.html.twig') import icon  %}
  3. <section class="section gradient-pink-orange-light">
  4.     <div class="container-fluid">
  5.         <div class="section__title">
  6.             <h2 class="h1 text-center underline-bottom">
  7.                 {{ 'site.home.sections.testimonies2.title'|trans }}
  8.                 {% if affiliateForLegalNotices(tracking) %}
  9.                     <sup>*</sup>
  10.                 {% endif %}
  11.             </h2>
  12.             <div class="mt-4 text-center">
  13.                 <div class="rating-preview" style="--icon-size: 3rem; --rating: {{ marketingTestimoniesInfo.averageRating / 5 * 100 }}%"></div>
  14.             </div>
  15.             <p class="h3 text-center mt-1">
  16.                 {{ marketingTestimoniesInfo.averageRating|number_format(1, ',') }}/5 
  17.                 {# ({{ marketingTestimoniesInfo.numberTestimonies }}
  18.                 {{ 'site.home.sections.testimonies2.subtitle'|trans }}) #}
  19.             </p>
  20.         </div>
  21.         {% set testimoniesLength = testimonies|length %}
  22.         {% set startFromTestimony =  random(0, testimoniesLength) %}
  23.         {% set itemsPerPage = 4 %}
  24.         {% if testimonies and testimonies | length > 0 %}
  25.             <div class="testimonie-list mb-2">
  26.                 {% for item in testimonies %}
  27.                     {% if loop.index < 5 %}
  28.                         <div class="testimonie-list__item">
  29.                             <div class="testimonie">
  30.                                 <div class="d-flex justify-content-between mb-3">
  31.                                     <div class="testimonie__rating">
  32.                                         <span class="testimonie__rating__holder">
  33.                                             <span data-rating="{{item.rating}}"></span>
  34.                                         </span>
  35.                                     </div>
  36.                                     <div class="testimonie__meta">
  37.                                         {% if item.weightLoss %}
  38.                                             <span>{{ item.weightLoss |round(1, 'floor') }}
  39.                                                 {{ 'site.testimonies.kgInfo'|trans }}</span>
  40.                                         {% endif %}
  41.                                     </div>
  42.                                 </div>
  43.                                 <div class="testimonie__review mb-2">
  44.                                     <p>“{{ item.message }}”
  45.                                         {% if affiliateForLegalNotices(tracking) %}*
  46.                                         {% endif %}
  47.                                     </p>
  48.                                 </div>
  49.                                 <div class="d-flex justify-content-between mt-auto">
  50.                                     <div class="testimonie__user">
  51.                                         <h3 class="h5 mb-0 mt-0">
  52.                                             <span {% if item.country %} class="mr-1" {% endif %}>
  53.                                                 {{ item.firstname }},
  54.                                                 {{ item.city }}
  55.                                             </span>
  56.                                             {% if item.country %}
  57.                                                 <img src="{{ asset('/images/main/flags/' ~ item.country | upper ~ '.svg') }}" width="18" height="12" loading="lazy" alt="{{ item.country }}">
  58.                                             {% endif %}
  59.                                         </h3>
  60.                                         <p class="mb-0 font-sm">{{ item.age }}
  61.                                             {{ 'site.common.age'|trans }}
  62.                                             {# - {{ item.created_at |format_datetime('medium', 'none') }} #}
  63.                                         </p>
  64.                                     </div>
  65.                                     <div class="testimonie__date">
  66.                                         <p class="font-sm">
  67.                                             {{ item.testimonyDate|format_datetime(locale=app.request.locale ,pattern="d MMMM YYYY") }}
  68.                                         </p>
  69.                                     </div>
  70.                                 </div>
  71.                             </div>
  72.                         </div>
  73.                     {% endif %}
  74.                 {% endfor %}
  75.             </div>
  76.         {% endif %}
  77.         <p class="text-center">
  78.             <a href="{{ path('brulafine_avis_no_page') }}" class="btn btn-lg btn-default">{{ 'site.home.sections.testimonies.button'|trans }}</a>
  79.         </p>
  80.         {% if affiliateForLegalNotices(tracking) %}
  81.             <p class="font-xs mb-0 text-center">
  82.                 <sup>*</sup>
  83.                 {{ 'site.home.sections.testimonies2.text'|trans }}
  84.             </p>
  85.         {% endif %}
  86.         {% if isAllowedToSeeDisclaimer(tracking) %}
  87.             <p class="font-xs"><sup>*</sup>{{ 'site.home.hero.testimonies.legal'|trans }}</p>
  88.         {% endif %}
  89.     </div>
  90. </section>