templates/component/care_card.html.twig line 1

Open in your IDE?
  1. {#
  2.     component: care card
  3.     image {image}: Image de l'offre
  4.         size: {
  5.             width: "340",
  6.             height: "200"
  7.         }
  8.     title {string}: Nom de l'offre
  9.     date {string}: Date
  10.     duration {string}: Nom de l'offre
  11.     text {string}: Texte de l'offre
  12.     categoryTitle {string}: Texte de l'offre
  13.     price {string}: Prix final de l'offre
  14.     price {string}: Prix final de l'offre avec réduction de prix
  15.     links: [{
  16.         icon {string}: Nom de l'icône du lien
  17.         text {string}: Texte du lien
  18.         to {string}: Lien
  19.     }]
  20.     aquao {string}: Url
  21. #}
  22. {% set props = {
  23.   image: null,
  24.   title: null,
  25.   date:null,
  26.   duration: null,
  27.   text: null,
  28.   categoryTitle: null,
  29.   price: null,
  30.   priceReduced: null,
  31.   links:[],
  32.   aquao:null
  33. }|merge(props|default({}))  %}
  34. <div data-component="care-card" class="CareCard-container" {% if props.links[0].to == "#" %} data-indexcalendar="{{ props.indexCalendar }}" data-id="{{ props.idCare }}" data-mindays="{{ props.minDays }}" data-maxdays="{{ props.maxDays }}" {% endif %} {% if props.aquao is defined and props.aquao %} data-aquao="{{props.aquao}}" {% endif %}>
  35.     <div
  36.         ref="card" class="CareCard-component">
  37.         {# Heading #}
  38.         <div
  39.             class="CareCard-heading">
  40.             {# Image #}
  41.             <div class="CareCard-backgroundImage" ref="heading">
  42.                 {% include "component/image.html.twig" with {
  43.                     props: props.image
  44.                 } %}
  45.                 {# {% include "component/picture.html.twig" with {
  46.                                     props: props.image|merge({
  47.                                         srcWebp: (props.image.src) ? asset(props.image.src | imagine_filter('convert_img_to_webp')) : ''
  48.                                     })
  49.                                 } %} #}
  50.             </div>
  51.             {# Title #}
  52.             <p class="CareCard-title" ref="title">{{ props.title|raw }}</p>
  53.         </div>
  54.         {# Main #}
  55.         <div
  56.             class="CareCard-main">
  57.             {# Duration #}
  58.             <div
  59.                 class="CareCard-duration" ref="duration">
  60.                 {# Duration icon #}
  61.                 <div class="CareCard-durationIcon">
  62.                     {% include "component/svg.html.twig" with {
  63.                         props: {
  64.                             name: 'schedule'
  65.                         }
  66.                     } %}
  67.                 </div>
  68.                 {# Duration text #}
  69.                 <span class="CareCard-durationText">{{ props.duration }}</span>
  70.             </div>
  71.             <div
  72.                 class="CareCard-content" ref="main">
  73.                 {# Text #}
  74.                 {% if props.date %}
  75.                     <p class="CareCard-date">{{ props.date|raw }}</p>
  76.                 {% endif %}
  77.                 <p class="CareCard-text" ref="titleAnnex">{{ props.categoryTitle | raw }}</p>
  78.                 {# Price #}
  79.                 {% if props.price %}
  80.                     {% if props.priceReduced %}
  81.                         <div class="CareCard-price">
  82.                             <span class="previous">{{ props.price | raw }}</span>
  83.                             <span>{{props.priceReduced|raw}}</span>
  84.                         </div>
  85.                     {% else %}
  86.                         <div class="CareCard-price">{{ props.price | raw }}</div>
  87.                     {% endif %}
  88.                 {% endif %}
  89.                 {# Buttons #}
  90.                 <div class="CareCard-buttons {% if props.links|length < 2 %} single-button {% endif %} ">
  91.                     {% for link in props.links %}
  92.                         {% include "component/button.html.twig" with {
  93.                             props: {
  94.                                 text: link.text,
  95.                                 to: link.to,
  96.                                 bookingLink: link.bookingLink is defined ? link.bookingLink : null ,
  97.                                 rel: "nofollow"
  98.                             }|merge_object({
  99.                                 icon: link.icon,
  100.                                 externe : link.externe is defined ? link.externe :null,
  101.                             })
  102.                         } %}
  103.                     {% endfor %}
  104.                 </div>
  105.             </div>
  106.         </div>
  107.     </div>
  108.     <div
  109.         ref="backCard" class="BackCareCard-component">
  110.         {# Heading #}
  111.         <div
  112.             class="CareCard-heading">
  113.             {# Duration #}
  114.             <div
  115.                 class="CareCard-duration" ref="backDuration">
  116.                 {# Duration icon #}
  117.                 <div class="CareCard-durationIcon">
  118.                     {% include "component/svg.html.twig" with {
  119.                         props: {
  120.                             name: 'schedule'
  121.                         }
  122.                     } %}
  123.                 </div>
  124.                 {# Duration text #}
  125.                 <span class="CareCard-durationText">{{ props.duration }}</span>
  126.             </div>
  127.             {# Title #}
  128.             <p class="CareCard-title">{{ props.title|raw }}</p>
  129.         </div>
  130.         {# Main #}
  131.         <div class="CareCard-main">
  132.             {% include "component/wysiwyg.html.twig" with {
  133.                 props: {
  134.                     content: props.text
  135.                 }
  136.             } %}
  137.             {# Price #}
  138.             {% if props.price %}
  139.                 {% if props.priceReduced %}
  140.                     <div class="CareCard-price">
  141.                         <span class="previous">{{ props.price | raw }}</span>
  142.                         <span>{{props.priceReduced|raw}}</span>
  143.                     </div>
  144.                 {% else %}
  145.                     <div class="CareCard-price">{{ props.price | raw }}</div>
  146.                 {% endif %}
  147.             {% endif %}
  148.             {# Buttons #}
  149.             <div class="CareCard-buttons">
  150.                 {% for link in props.links %}
  151.                     {% include "component/button.html.twig" with {
  152.                             props: {
  153.                                 text: link.text,
  154.                                 to: link.to,
  155.                                 rel: "nofollow",
  156.                                 bookingLink: link.bookingLink is defined ? link.bookingLink : null
  157.                             }|merge_object({
  158.                                 icon: link.icon,
  159.                                 externe : link.externe is defined ? link.externe :null,
  160.                             })
  161.                         } %}
  162.                 {% endfor %}
  163.             </div>
  164.         </div>
  165.     </div>
  166. </div>