generated from gitea_admin/default
267 lines
8.7 KiB
Vue
267 lines
8.7 KiB
Vue
<template>
|
|
<div class="entreprise--page">
|
|
<!-- ================== -->
|
|
<!-- FILS D'ARIANE -->
|
|
<!-- ================== -->
|
|
<PageSection tone="" content-size="default" class="breadcrum_wp">
|
|
<Breadcrumb/>
|
|
</PageSection>
|
|
|
|
<!-- ================== -->
|
|
<!-- EN-TêTE -->
|
|
<!-- ================== -->
|
|
<section class="fiche_header_simple_wp">
|
|
<div class="fiche_header_wp_gauche"></div>
|
|
|
|
<div class="fiche_header_inner">
|
|
<div class="fiche_header_titres">
|
|
<div>
|
|
<DsHeading as="h1" tone="default" textcase="uppercase" class="concert-card__title">
|
|
{{entreprise_donnees_servies.header_titre}}
|
|
</DsHeading>
|
|
</div>
|
|
|
|
<DsText as="p" align="justify">
|
|
{{entreprise_donnees_servies.header_text}}
|
|
</DsText>
|
|
</div>
|
|
<div class="fiche_header_img">
|
|
<DsMedia
|
|
v-if="entreprise_donnees_servies?.header_illustration?.url"
|
|
:src="entreprise_donnees_servies.header_illustration.url"
|
|
:alt="entreprise_donnees_servies.header_illustration.alternativeText || ''"
|
|
fit="cover"
|
|
ratio="square"
|
|
/>
|
|
|
|
<div v-else class="img_placeholder" aria-hidden="true" />
|
|
</div>
|
|
|
|
</div>
|
|
<div class="fiche_header_wp_droite"></div>
|
|
|
|
</section>
|
|
|
|
<!-- ================== -->
|
|
<!-- CHIFFRES -->
|
|
<!-- ================== -->
|
|
<PageSection
|
|
v-if="hasentrepriseChiffres"
|
|
tone=""
|
|
content-size="default"
|
|
padded_size="md"
|
|
class="chiffres_wp"
|
|
>
|
|
<Chiffres
|
|
:title="entreprise_donnees_servies?.chiffres_entreprise?.Titre"
|
|
:items="entrepriseChiffres"
|
|
/>
|
|
</PageSection>
|
|
|
|
<!-- ================== -->
|
|
<!-- AFFICHAGE DES PARTIE EN DÉCALLAGE AVEC LE CONTENU PROVENANT DE STRAPI -->
|
|
<!-- ================== -->
|
|
<template v-for="(t, index) in tiroirs" :key="index">
|
|
<PageSection :content="false" :class="{ 'decalage-section--spaced': index > 0 }">
|
|
<Decalage
|
|
:tone="t.decalage_couleur"
|
|
title-tone="invert"
|
|
:position="t.decalage_sens"
|
|
button-tone="invert"
|
|
:ensavoirplus-target="t.tiroir_ouvert ? undefined : `texte_cache_${index + 3}`"
|
|
:ensavoirplus-group="t.tiroir_ouvert ? undefined : 'entreprise-details'"
|
|
>
|
|
<template #title>
|
|
{{ t.decalage_titre }}
|
|
</template>
|
|
<DsText as="p" tone="invert" :align="t.decalage_sens">
|
|
{{ t.decalage_texte }}
|
|
</DsText>
|
|
</Decalage>
|
|
</PageSection>
|
|
<PageSection
|
|
:id="`texte_cache_${index + 3}`"
|
|
:data-ensavoirplus-group="t.tiroir_ouvert ? undefined : 'entreprise-details'"
|
|
tone=""
|
|
content-size="default"
|
|
padded_size=""
|
|
:class="{ 'decalage_ensavoirplus--hidden': !t.tiroir_ouvert }"
|
|
>
|
|
<section v-if="t.tiroir_galerie.length" class="img-gallery_wp">
|
|
<div class="img-gallery">
|
|
<DsMedia
|
|
v-for="img in t.tiroir_galerie"
|
|
:key="img.id || img.url"
|
|
:src="img.url"
|
|
:alt="img.alternativeText"
|
|
/>
|
|
</div>
|
|
</section>
|
|
<SectionContent class="fiche_description">
|
|
<StrapiBlocksConvert :blocks="t.tiroir_description" />
|
|
</SectionContent>
|
|
<section v-if="t.tiroir_videos.length" class="youtube_wp">
|
|
<div class="youtube-list">
|
|
<div v-for="v in t.tiroir_videos" :key="v.id" class="youtube-item">
|
|
<iframe
|
|
:src="v.lien_youtube"
|
|
title="Vidéo YouTube"
|
|
loading="lazy"
|
|
referrerpolicy="strict-origin-when-cross-origin"
|
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
|
allowfullscreen
|
|
/>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</PageSection>
|
|
</template>
|
|
|
|
|
|
<!-- ================== -->
|
|
<!-- CONTACT -->
|
|
<!-- ================== -->
|
|
|
|
<PageSection tone="" content-size="default" padded_size="md" class="contact_spe_wp">
|
|
<ContactSpecifique
|
|
titre="Contacter le service mécénat"
|
|
nom="Pierre Brouchoud et Audrey Chauvelot"
|
|
poste="Responsables du mécénat"
|
|
mail="pierre.brouchoud@orchestre-ile.com / audrey.chauvelot@orchestre-ile.com"
|
|
adresse=""
|
|
/>
|
|
</PageSection>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import DsHeading from '@root/design-system/primitives/DsHeading.vue'
|
|
import DsText from '@root/design-system/primitives/DsText.vue'
|
|
import DsMedia from '@root/design-system/primitives/DsMedia.vue'
|
|
import { computed } from 'vue'
|
|
|
|
// ======================================
|
|
// RÉCUPÉRATION DES DONNÉES DANS STRAPI
|
|
// ======================================
|
|
|
|
const endpoint = "/api/__strapi__/entreprise"
|
|
const populate = {
|
|
header_illustration: true,
|
|
chiffres_entreprise: {chiffres: true},
|
|
tiroirs_entreprise: {
|
|
decalage_parametres: true,
|
|
tiroir_galerie: true,
|
|
tiroir_videos: true,
|
|
},
|
|
}
|
|
|
|
const { items: entreprise, pending, error } = useStrapi(
|
|
endpoint,
|
|
{
|
|
locale: "fr-FR",
|
|
populate,
|
|
limit: 1,
|
|
}
|
|
)
|
|
|
|
// ======================================
|
|
// PRÉPARATION DES DONNÉES POUR AFFICHAGE DANS LA PAGE
|
|
// ======================================
|
|
const entreprise_donnees_servies = computed(() => entreprise.value?.[0] || {})
|
|
|
|
const entrepriseChiffres = computed(() =>
|
|
(entreprise.value?.[0]?.chiffres_entreprise?.chiffres || []).map((item) => ({
|
|
value: item.chiffre,
|
|
label: item.label,
|
|
}))
|
|
)
|
|
|
|
const hasentrepriseChiffres = computed(() => (
|
|
Boolean(entreprise_donnees_servies.value?.chiffres_entreprise?.Titre)
|
|
|| entrepriseChiffres.value.length > 0
|
|
))
|
|
|
|
const tiroirs = computed(() =>
|
|
(entreprise.value?.[0]?.tiroirs_entreprise || []).map((tiroir_item) => ({
|
|
decalage_titre: tiroir_item.decalage_parametres?.decalage_titre,
|
|
decalage_texte: tiroir_item.decalage_parametres?.decalage_texte,
|
|
tiroir_ouvert: Boolean(tiroir_item.decalage_parametres?.tiroir_ouvert),
|
|
decalage_sens:
|
|
tiroir_item.decalage_parametres?.decalage_sens === "droite" ? "right" : "left",
|
|
decalage_couleur:
|
|
tiroir_item.decalage_parametres?.decalage_couleur === "rouge"
|
|
? "brand"
|
|
: tiroir_item.decalage_parametres?.decalage_couleur === "vert clair"
|
|
? "brandreverse"
|
|
: tiroir_item.decalage_parametres?.decalage_couleur === "jaune"
|
|
? "jaune"
|
|
: "dark",
|
|
tiroir_description: tiroir_item.tiroir_description,
|
|
tiroir_galerie: (tiroir_item.tiroir_galerie || []).map((tiroir_item_img) => ({
|
|
id: tiroir_item_img.id,
|
|
url: tiroir_item_img.url,
|
|
alt: tiroir_item_img.alternativeText,
|
|
})),
|
|
tiroir_videos: (tiroir_item.tiroir_videos || [])
|
|
.map((tiroir_item_video) => {
|
|
const id = getYoutubeId(tiroir_item_video?.lien_youtube)
|
|
if (!id) return null
|
|
|
|
return {
|
|
id: tiroir_item_video.id || id,
|
|
lien_youtube: `https://www.youtube-nocookie.com/embed/${id}?rel=0&modestbranding=1&iv_load_policy=3&playsinline=1`,
|
|
}
|
|
})
|
|
.filter(Boolean),
|
|
}))
|
|
)
|
|
|
|
function getYoutubeId(url = "") {
|
|
try {
|
|
const u = new URL(url)
|
|
if (u.hostname.includes("youtu.be")) return u.pathname.slice(1)
|
|
if (u.pathname.startsWith("/shorts/")) return u.pathname.split("/")[2]
|
|
if (u.pathname.startsWith("/embed/")) return u.pathname.split("/")[2]
|
|
return u.searchParams.get("v")
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
// =======================
|
|
// SPÉCIFIQUE À CETTE PAGE
|
|
// =======================
|
|
.entreprise--page {
|
|
.chiffres_wp {
|
|
background-color: var(--c-background-vert);
|
|
margin-bottom: 50px;
|
|
}
|
|
.fiche_description {
|
|
display: flex;
|
|
justify-content: center;
|
|
padding-bottom: 10px;
|
|
padding-left: 10px;
|
|
padding-right: 10px;
|
|
> * {
|
|
max-width: 640px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
.contact_spe_wp {
|
|
background-color: var(--c-background-jaune-clair);
|
|
margin-top: 50px;
|
|
margin-bottom: 40px;
|
|
}
|
|
}
|
|
|
|
/* ============================ */
|
|
/* GALERIES */
|
|
/* ============================ */
|
|
|
|
</style>
|