{#
page: thalasso niveau 2
#}
{% extends "layouts/base.html.twig" %}
{% set jsPageId = 'thalasso-detail' %}
{% set pageClass = 'Thalasso-detail' %}
{% block content %}
{# Header #}
{% include "component/header.html.twig" with {
props: {
account:{
link: path("app_signin", { '_locale': app.request.getLocale() }),
text: "myaccount.title"|trans
}
}
} %}
{# Hero content #}
{% include "component/hero_content.html.twig" with {
props: {
heading: {
title: frontservice.getHeaderFields(page, 'header_titre', lang)|nl2br,
titleAnnex: frontservice.getHeaderFields(page, 'header_sur_titre', lang)|nl2br
},
breadcrumb: frontservice.getBreadcrumb(page, lang),
background: frontservice.getMediaPublicUrl(page.headerImage, 'reference', frontservice.getHeaderFields(page, 'alt_header_img', lang)),
video:(frontservice.getHeaderVideo(page)) ? {
type:'video/mp4',
src: asset(frontservice.getHeaderVideo(page))
} : null
}
} only %}
{# Filter Bar #}
{# {% include "component/header/filter_bar.html.twig" with {
props:{
bookingtitle:"booking.title"|trans,
}
} only %} #}
{% if composants %}
{% set items_calendar = [] %}
{% set index = 0 %}
{% for composant in composants %}
{% if frontservice.getContentField(composant, 'masquer', lang) != 1 %}
{% set titre_principal = frontservice.getContentField(composant, 'titre_principal', lang)|replace({"\n": "<br />"})|raw %}
{% set surtitre = frontservice.getContentField(composant, 'surtitre', lang) %}
{% set introDescription = frontservice.getContentField(composant, 'intro_description', lang)|replace({"\n": "<br />"})|raw %}
{% set introDescriptionSecondaire = frontservice.getContentField(composant, 'intro_description_secondaire', lang)|replace({"\n": "<br />"})|raw %}
{# Introduction #}
{% if composant.cmsComposant.nomTechniqueComposant == "component/introduction.html.twig" %}
{% include "component/introduction.html.twig" with {
props: {
text: {
first: '<p>'~ introDescription ~'</p>',
second: '<p>'~ introDescriptionSecondaire ~'</p>'
},
}
} %}
{% endif %}
{# Care cards #}
{% if composant.cmsComposant.nomTechniqueComposant == "component/care_cards.html.twig" %}
{% set care_cards_items = composant.getCmsPageBlockComposantItems() %}
{% set items_elements = [] %}
{% if care_cards_items %}
{% for item in care_cards_items %}
{% set produit_thalasso_id = null %}
{% if item.produitThalasso %}
{% set produit_thalasso_id = item.produitThalasso.id %}
{% set min_days = (item.produitThalasso.dureeJours == 0) ? 1 : item.produitThalasso.dureeJours %}
{% set max_days = min_days %}
{% set items_calendar = items_calendar|merge([{prod_id: item.produitThalasso.id}]) %}
{% else %}
{% set min_days = 1 %}
{% set max_days = 1 %}
{% set items_calendar = items_calendar|merge([{prod_id: 0}]) %}
{% endif %}
{% set produit_url = (produit_thalasso_id) ? path("process_choice_signature", { 'idp': produit_thalasso_id }) : null %}
{% set produit_url_gift = (produit_thalasso_id) ? path("process_choice_signature_gift", { 'idp': produit_thalasso_id, 'g':1}) : null %}
{% set item_url = null %}
{% set item_sec_url = null %}
{% set all_links = [] %}
{% if item.urlLienPrincipalPage %}
{% set item_url = frontservice.getUrlPage(item.urlLienPrincipalPage, lang) %}
{% else %}
{% set item_url = frontservice.getContentItemField(item, 'url_lien_principal', lang) %}
{% endif %}
{% if item.urlLienSecondairePage %}
{% set item_sec_url = frontservice.getUrlPage(item.urlLienSecondairePage, lang) %}
{% else %}
{% set item_sec_url = frontservice.getContentItemField(item, 'url_lien_secondaire', lang) %}
{% endif %}
{% set all_links = all_links|merge([{
icon: '',
text: frontservice.getContentItemField(item, 'label_lien_principal', lang),
to: "#"
}]) %}
{% if frontservice.getContentItemField(item, 'label_lien_secondaire', lang) and produit_url_gift %}
{% set all_links = all_links|merge([{
icon: 'gift',
text: frontservice.getContentItemField(item, 'label_lien_secondaire', lang),
to: null,
bookingLink: produit_url_gift
}]) %}
{% endif %}
{% set pricedisplay = { price : null, originalPrice: null} %}
{% set prix_apartir = frontservice.getContentItemField(item, 'prix_apartir', lang) %}
{% set priceValue = prix_apartir %}
{% if produit_thalasso_id %}
{% set mode_heb = ('sans' in item.ProduitThalasso.hebergement) ? false : true %}
{% set pricedisplay = getCalendarThalasso(produit_thalasso_id, mode_heb, true) %}
{% if pricedisplay is null %}{% set pricedisplay = { price : null, originalPrice: null} %}{% endif %}
{% set displayedPrice = (pricedisplay) ? pricedisplay.price : null %}
{% if displayedPrice %}
{% set priceValue = displayedPrice %}
{% else %}
{% set priceValue = (prix_apartir) ? prix_apartir : "Indisponible" %}
{% endif %}
{% endif %}
{% if priceValue and priceValue != "Indisponible" %}
{% set priceValue = priceValue|number_format(2,'.','')|replace({'.00': ''}) %}
{% if '€' not in priceValue %}
{% set priceValue = priceValue ~ '€' %}
{% endif %}
{% endif %}
{% set image = frontservice.getMediaPublicUrl(item.imagePrincipal, 'big', frontservice.getContentItemField(item, 'alt_p', lang)) %}
{% set items_elements = items_elements|merge([{
image : image,
title: frontservice.getContentItemField(item, 'titre_principal', lang)|replace({"\n": "<br />"})|raw,
duration: frontservice.getContentItemField(item, 'duration', lang),
categoryTitle: frontservice.getContentItemField(item, 'category_produit', lang),
text: frontservice.getContentItemField(item, 'description', lang),
price: priceValue,
links: all_links,
idCare:(item.produitThalasso) ? item.produitThalasso.id : 0,
indexCalendar:index,
minDays:min_days,
maxDays:max_days
}]) %}
{% set index = index + 1 %}
{% endfor %}
{% endif %}
{% include "component/care_cards.html.twig" with {
props: {
heading: {
titleAnnex: titre_principal
},
items: items_elements
}
} only %}
{% endif %}
{# To discover #}
{% if composant.cmsComposant.nomTechniqueComposant == "component/to_discover.html.twig" %}
{% set to_discover_items = composant.getCmsPageBlockComposantItems() %}
{% set items_elements = [] %}
{% if to_discover_items %}
{% for item in to_discover_items %}
{% set item_url = '#' %}
{% if item.urlLienPrincipalPage %}
{% set item_url = frontservice.getUrlPage(item.urlLienPrincipalPage, lang) %}
{% else %}
{% set item_url = frontservice.getContentItemField(item, 'url_lien_principal', lang) %}
{% endif %}
{% set image = frontservice.getMediaPublicUrl(item.imagePrincipal, 'big', frontservice.getContentItemField(item, 'alt_p', lang)) %}
{% set items_elements = items_elements|merge([{
image: image,
heading: {
title: frontservice.getContentItemField(item, 'titre_principal', lang)|replace({"\n": "<br />"})|raw,
titleAnnex: frontservice.getContentItemField(item, 'surtitre', lang)
},
to: item_url
}]) %}
{% endfor %}
{% endif %}
{% include "component/to_discover.html.twig" with {
props: {
heading: {
title: titre_principal,
titleAnnex: surtitre
},
items: items_elements
}
} only %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{# Calendar #}
{% set datacal = [] %}
{% if items_calendar is not empty %}
{% for item in items_calendar %}
{% set datacal = datacal|merge(getCalendarThalasso(item.prod_id,false)) %}
{% endfor %}
{% endif %}
{% include "component/calendar.html.twig" with {
props: {
form: {
action: path("process_choice_signature", { 'idp': 0 }),
link: {
text: 'Continuer'
},
},
lang:'fr',
},
data : datacal
} only %}
{# Footer #}
{% include "component/footer.html.twig" %}
{% endblock %}