theme modale etape

This commit is contained in:
Valentin
2024-09-11 19:53:18 +02:00
parent c2d8eb99cf
commit ebb3ceb6d5
6 changed files with 270 additions and 11 deletions

View File

@@ -8,13 +8,25 @@ export const useContentStore = defineStore('content', {
title: '',
adresse: {},
etape_number: '',
dates: {},
dates: {
start: {
d: '',
m: '',
y: '',
},
end: {
d: '',
m: '',
y: '',
},
},
geofield: {},
galeries: [],
parties: [],
saison: {},
thematiques: [],
vignette: {},
couleur: '',
},
page: {
title: '',
@@ -41,7 +53,20 @@ export const useContentStore = defineStore('content', {
this.etape.title = etape.attributes.title;
this.etape.adresse = etape.attributes.field_adresse;
this.etape.etape_number = etape.attributes.field_arret_numero;
this.etape.dates = etape.attributes.field_dates;
//this.etape.dates = etape.attributes.field_dates;
this.etape.dates = {
start: {
d: etape.attributes.field_dates.value.split('-')[2],
m: new Intl.DateTimeFormat('fr-FR', { month: 'long' }).format(new Date(etape.attributes.field_dates.value)),
y: etape.attributes.field_dates.value.split('-')[0],
},
end: {
d: etape.attributes.field_dates.end_value.split('-')[2],
m: new Intl.DateTimeFormat('fr-FR', { month: 'long' }).format(new Date(etape.attributes.field_dates.end_value)),
y: etape.attributes.field_dates.end_value.split('-')[0],
},
}
this.etape.geofield = etape.attributes.field_geofield;
this.etape.galeries = await this.fetchEtapeContent('field_galleries', etape.relationships);
const partiesFetch = await this.fetchEtapeContent('field_parties', etape.relationships);
@@ -55,6 +80,7 @@ export const useContentStore = defineStore('content', {
this.etape.thematiques = await this.fetchEtapeContent('field_thematiques', etape.relationships);
const vignetteFetch = await this.fetchEtapeContent('field_vignette', etape.relationships);
this.etape.vignette = { url: vignetteFetch.attributes.uri.url, alt: etape.attributes.field_vignette_alt };
this.etape.couleur = etape.attributes.field_couleur;
this.setActiveItemInMenu();
break;
}