| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <template>
- <LayoutContainer>
- <v-row>
- <v-col cols="12">
- <CommonBanner
- imageSrc="/images/actu/pub.png"
- imageAlt="banner"
- />
- </v-col>
- </v-row>
- <div class="news-section">
- <v-row class="mb-6 custom-row">
- <v-col class="d-flex align-items-center">
- <v-btn
- to="/actualites"
- prepend-icon="fas fa-arrow-left"
- variant="outlined"
- class="back-button"
- >
- Retour aux actualités
- </v-btn>
- </v-col>
- </v-row>
- <div>
- <div v-if="pending">
- <v-row class="justify-center progress">
- <v-progress-circular
- indeterminate
- color="grey"
- />
- </v-row>
- </div>
- <div v-else-if="newsItem !== null" class="news">
- <v-row class="custom-row">
- <v-col cols="6">
- <v-img :src="getImageUrl(newsItem.attachment)"/>
- </v-col>
- <v-col cols="6">
- <h4>
- {{ newsItem.title }}
- </h4>
- </v-col>
- </v-row>
- <v-row class="custom-row">
- <p class="description">
- <!-- TODO: idem que pour les annonces -->
- {{ newsItem.bodyText }}
- </p>
- </v-row>
- <v-row class="d-flex justify-center align-center">
- <v-btn prepend-icon="fas fa-info" class="btn-plus mb-12" text>
- En savoir plus
- </v-btn>
- </v-row>
- <v-row class="d-flex justify-space-between custom-row">
- <p>
- MOTS CLÉS
- </p>
- <div>
- <p>PARTAGER</p>
- </div>
- </v-row>
- <v-row class="d-flex justify-space-between mb-8 custom-row">
- <p class="key-word mt-3">
- <!-- TODO: remplacer par la bonne prop -->
- ROCK CONCERT FESTIVAL
- </p>
- <CommonShare />
- </v-row>
- </div>
- </div>
- </div>
- <CommonAgenda />
- </LayoutContainer>
- </template>
- <script setup lang="ts">
- import { useEntityFetch } from "~/composables/data/useEntityFetch";
- import News from "~/models/Maestro/News";
- const route = useRoute();
- const { fetch } = useEntityFetch()
- const config = useRuntimeConfig()
- const newsId: number = parseInt(route.params.id as string)
- if (!newsId || isNaN(newsId)) {
- throw new Error('Missing or invalid id')
- }
- const { data: newsItem, pending } = fetch(News, newsId)
- const getImageUrl = (attachment: string): string | null => {
- if (!attachment) {
- return null
- }
- return `${config.public.apiBaseUrl}/uploads/news/${attachment}`
- }
- </script>
- <style scoped>
- .custom-row {
- width: 90%;
- margin-left: auto;
- margin-right: auto;
- }
- .news {
- .v-img {
- width: 80%;
- margin-left: 3.5rem;
- margin-right: auto;
- }
- h4 {
- margin-top: 11rem;
- text-decoration: none;
- text-transform: uppercase;
- font-family: Barlow, serif;
- font-size: 36px;
- font-style: normal;
- font-weight: 600;
- }
- .description {
- color: #0e2d32;
- text-align: justify;
- font-family: "Barlow", serif;
- font-size: 30px;
- font-style: normal;
- font-weight: 500;
- line-height: 34px;
- margin-left: 3.5rem;
- margin-right: 3.5rem;
- margin-bottom: 3rem;
- }
- .btn-plus {
- background: var(--secondary-color);
- color: var(--on-secondary-color);
- display: flex;
- left: 0;
- padding: 25px 28px;
- align-items: center;
- gap: 9px;
- font-family: Barlow, serif;
- font-size: 0.9rem;
- border-radius: 5px;
- font-style: normal;
- font-weight: 700;
- line-height: 15px;
- letter-spacing: 1.3px;
- text-transform: uppercase;
- margin-bottom: -1rem;
- }
- }
- .back-button {
- text-decoration: none;
- color: #000000;
- font-family: Barlow, serif;
- font-size: 0.9rem;
- font-style: normal;
- font-weight: 700;
- line-height: 15px;
- letter-spacing: 1.8px;
- text-transform: uppercase;
- }
- .key-word {
- color: #000;
- font-family: Barlow, serif;
- font-size: 20px;
- font-style: normal;
- font-weight: 500;
- line-height: 24px;
- }
- </style>
|