home partout et pour tous

This commit is contained in:
2026-04-27 11:44:49 +02:00
parent 208456f98e
commit 6c2be0ca71
7 changed files with 87 additions and 45 deletions

View File

@@ -124,6 +124,8 @@ https://bo.orchestre-ile.com/api/pro-programmer?locale=fr-FR&populate[bios]=true
API Instruments
https://bo.orchestre-ile.com/api/parc-instruments?locale=fr-FR&populate=illustration_instrument
https://bo.orchestre-ile.com/api/home-partout-pour-tous?locale=fr-FR&populate[carte]=true&populate[carte][populate]=illustration=true
### Afficher les données récupérées ou les erreurs dans la console
const { items: scolaires, pending, error } = useStrapi(
endpoint,

View File

@@ -17,7 +17,7 @@
{{ title }}
</DsHeading>
<!-- Description -->
<DsText as="p" tone="default" :clamp="3" class="rounded-card__description">
<DsText as="p" tone="default" :clamp="6" class="rounded-card__description">
{{ description }}
</DsText>
@@ -47,7 +47,7 @@
<style lang="scss">
.rounded-card {
padding: 16px;
padding: 13px;
box-shadow: 0px -1px 20px rgba(0, 0, 0, 0.18);
.rounded-card__grid {
@@ -64,7 +64,7 @@
padding-top: 13px;
padding-bottom: 10px;
background: white;
max-width: 85%;
max-width: 93%;
justify-self: center;
position: relative;
margin-top: -7px;

View File

@@ -48,7 +48,7 @@
<!-- Sans couleur rouge par dessus -->
<SectionContent tone="" pad="" class="theme_ppt--content">
<SectionTitle tone="invert" pad="xs">
LA MUSIQUE PARTOUT ET POUR TOUS
{{ homePartoutPourTousTitle }}
</SectionTitle>
<SectionContent pad="xs" class="theme_ppt--description">
<DsText tone="invert" size="lg" class="theme_ppt--txt" >
@@ -69,8 +69,8 @@
class="theme_ppt"
:style="themePptCardsBgStyle"
>
<RoundedCardBlocTextList >
<RoundedCardBlocText
<RoundedCardList >
<RoundedCard
v-for="ppt_card in cards_ppt"
:key="ppt_card.id"
:id="ppt_card.id"
@@ -79,8 +79,8 @@
:title="ppt_card.title"
:description="ppt_card.description"
:url="ppt_card.url"
></RoundedCardBlocText>
</RoundedCardBlocTextList>
></RoundedCard>
</RoundedCardList>
</SectionContent>
</PageSection>
@@ -244,24 +244,63 @@
// DONNÉES POUR LES CARTES PARTOUT ET POUR TOUS
//--------------------------------------------------------------------------
const cards_ppt = ref([
const { items: homePartoutPourTous } = useStrapi(
"/api/__strapi__/home-partout-pour-tous",
{
id: '1',
imgSrc: '/contenus/actu1_1.jpg',
imgAlt: 'Femme en mouvement tenant deux cymbales, lune devant elle et lautre derrière, sur fond de mur blanc, dans une posture dynamique évoquant la musique et le rythme',
title: "La nouvelle saison est !",
description: ``,
url:"https://www.orchestre-ile.com/concerts/saison?saison=2026/2027",
locale: "fr-FR",
populate: {
carte: {
illustration: true,
},
{
id: '1',
imgSrc: '/contenus/insta_ondif_1.jpg',
imgAlt: 'le titre du post',
title: "6€ la place dès 3 concerts pour les - de 28 ans",
description: `à la Philharmonie de Paris - Cité de la musique`,
url:"https://ondif.shop.secutix.com/selection/subscription?productId=10229737867151",
},
])
limit: 1,
}
)
const homePartoutPourTousContent = computed(() => homePartoutPourTous.value?.[0] || null)
const homePartoutPourTousTitle = computed(() =>
homePartoutPourTousContent.value?.titre || "LA MUSIQUE PARTOUT ET POUR TOUS"
)
const cards_ppt = computed(() => {
const cartes = homePartoutPourTousContent.value?.carte || []
const publishedCards = cartes.filter((carte) => carte.publication !== false)
return publishedCards.map((carte, index) => {
const image = getStrapiCardImage(carte)
return {
id: carte.id || String(index + 1),
imgSrc: image?.url || "",
imgAlt: image?.alternativeText || image?.caption || carte.titre || "",
title: carte.titre || "",
description: strapiBlocksToText(carte.description),
url: carte.url || "",
}
})
})
function getStrapiCardImage(carte) {
const image = carte.illustration || null
return Array.isArray(image) ? image[0] : image
}
function strapiBlocksToText(blocks) {
if (!blocks) return ""
if (typeof blocks === "string") return blocks
if (!Array.isArray(blocks)) return ""
return blocks
.map((block) =>
(block.children || [])
.map((child) => child.text || "")
.join("")
)
.filter(Boolean)
.join("\n")
}

View File

@@ -42,8 +42,8 @@
class="theme_ppt"
:style="themePptCardsBgStyle"
>
<RoundedCardBlocTextList >
<RoundedCardBlocText
<RoundedCardList >
<RoundedCard
v-for="ppt_card in cards_ppt"
:key="ppt_card.id"
:id="ppt_card.id"
@@ -52,8 +52,8 @@
:title="ppt_card.title"
:description="ppt_card.description"
:url="ppt_card.url"
></RoundedCardBlocText>
</RoundedCardBlocTextList>
></RoundedCard>
</RoundedCardList>
</SectionContent>
</PageSection>

View File

@@ -35,8 +35,8 @@
class="theme_ppt"
:style="themePptCardsBgStyle"
>
<RoundedCardBlocTextList >
<RoundedCardBlocText
<RoundedCardList >
<RoundedCard
v-for="card in cards_subvention"
:key="card.id"
:id="card.id"
@@ -46,8 +46,8 @@
:description="card.description"
:url="card.url"
ratio="square"
></RoundedCardBlocText>
</RoundedCardBlocTextList>
></RoundedCard>
</RoundedCardList>
</SectionContent>
</PageSection>
@@ -81,8 +81,8 @@
class="theme_ppt"
:style="themePptCardsBgStyle"
>
<RoundedCardBlocTextList >
<RoundedCardBlocText
<RoundedCardList >
<RoundedCard
v-for="card in cards_inst_ass"
:key="card.id"
:id="card.id"
@@ -92,8 +92,8 @@
:description="card.description"
:url="card.url"
ratio="5-4"
></RoundedCardBlocText>
</RoundedCardBlocTextList>
></RoundedCard>
</RoundedCardList>
</SectionContent>
</PageSection>
@@ -127,8 +127,8 @@
class="theme_ppt"
:style="themePptCardsBgStyle"
>
<RoundedCardBlocTextList >
<RoundedCardBlocText
<RoundedCardList >
<RoundedCard
v-for="card in cards_prives"
:key="card.id"
:id="card.id"
@@ -138,8 +138,8 @@
:description="card.description"
:url="card.url"
ratio="5-4"
></RoundedCardBlocText>
</RoundedCardBlocTextList>
></RoundedCard>
</RoundedCardList>
</SectionContent>
</PageSection>
@@ -170,8 +170,8 @@
class="theme_ppt"
:style="themePptCardsBgStyle"
>
<RoundedCardBlocTextList >
<RoundedCardBlocText
<RoundedCardList >
<RoundedCard
v-for="card in cards_ensei_sup"
:key="card.id"
:id="card.id"
@@ -181,8 +181,8 @@
:description="card.description"
:url="card.url"
ratio="5-4"
></RoundedCardBlocText>
</RoundedCardBlocTextList>
></RoundedCard>
</RoundedCardList>
</SectionContent>
</PageSection>

View File

@@ -21,6 +21,7 @@ const COLLECTION_MAP = {
"pro-programmer": "/api/pro-programmer",
"parametres": "/api/parametres",
instruments: "/api/parc-instruments",
"home-partout-pour-tous": "/api/home-partout-pour-tous",
}
export default defineEventHandler(async (event) => {