Details.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <LayoutContainer>
  3. <v-row>
  4. <v-col cols="12">
  5. <CommonBanner
  6. imageSrc="/images/actu/pub.png"
  7. imageAlt="banner"
  8. />
  9. </v-col>
  10. </v-row>
  11. <div class="news-section">
  12. <v-row class="mb-6 center-90">
  13. <v-col class="d-flex align-items-center">
  14. <v-btn
  15. to="/actualites"
  16. prepend-icon="fas fa-arrow-left"
  17. variant="outlined"
  18. class="back-button"
  19. >
  20. Retour aux actualités
  21. </v-btn>
  22. </v-col>
  23. </v-row>
  24. <div>
  25. <div v-if="pending">
  26. <v-row class="justify-center progress">
  27. <v-progress-circular
  28. indeterminate
  29. color="grey"
  30. />
  31. </v-row>
  32. </div>
  33. <div v-else-if="newsItem !== null" class="news">
  34. <v-row class="center-90">
  35. <v-col cols="6">
  36. <v-img :src="getImageUrl(newsItem.attachment)"/>
  37. </v-col>
  38. <v-col cols="6">
  39. <h4>
  40. {{ newsItem.title }}
  41. </h4>
  42. </v-col>
  43. </v-row>
  44. <v-row class="center-90">
  45. <p
  46. v-html="newsItem.bodyText"
  47. class="description"
  48. />
  49. </v-row>
  50. <v-row class="d-flex justify-center align-center">
  51. <v-btn prepend-icon="fas fa-info" class="btn-plus mb-12" text>
  52. En savoir plus
  53. </v-btn>
  54. </v-row>
  55. <v-row class="d-flex justify-space-between center-90">
  56. <p>
  57. MOTS CLÉS
  58. </p>
  59. <div>
  60. <p>PARTAGER</p>
  61. </div>
  62. </v-row>
  63. <v-row class="d-flex justify-space-between mb-8 center-90">
  64. <p class="key-word mt-3">
  65. <!-- TODO: remplacer par la bonne prop -->
  66. ROCK CONCERT FESTIVAL
  67. </p>
  68. <CommonShare />
  69. </v-row>
  70. </div>
  71. </div>
  72. </div>
  73. <CommonAgenda />
  74. </LayoutContainer>
  75. </template>
  76. <script setup lang="ts">
  77. import { useEntityFetch } from "~/composables/data/useEntityFetch";
  78. import News from "~/models/Maestro/News";
  79. const route = useRoute();
  80. const { fetch } = useEntityFetch()
  81. const config = useRuntimeConfig()
  82. const newsId: number = parseInt(route.params.id as string)
  83. if (!newsId || isNaN(newsId)) {
  84. throw new Error('Missing or invalid id')
  85. }
  86. const { data: newsItem, pending } = fetch(News, newsId)
  87. const getImageUrl = (attachment: string): string | null => {
  88. if (!attachment) {
  89. return null
  90. }
  91. return `${config.public.apiBaseUrl}/uploads/news/${attachment}`
  92. }
  93. </script>
  94. <style scoped>
  95. .news {
  96. .v-img {
  97. width: 80%;
  98. margin-left: 3.5rem;
  99. margin-right: auto;
  100. }
  101. h4 {
  102. margin-top: 11rem;
  103. text-decoration: none;
  104. text-transform: uppercase;
  105. font-size: 36px;
  106. font-weight: 600;
  107. }
  108. .description {
  109. color: var(--primary-color);
  110. text-align: justify;
  111. font-size: 30px;
  112. font-weight: 500;
  113. line-height: 34px;
  114. margin-left: 3.5rem;
  115. margin-right: 3.5rem;
  116. margin-bottom: 3rem;
  117. }
  118. .btn-plus {
  119. background: var(--secondary-color);
  120. color: var(--on-secondary-color);
  121. display: flex;
  122. left: 0;
  123. padding: 25px 28px;
  124. align-items: center;
  125. gap: 9px;
  126. font-size: 0.9rem;
  127. border-radius: 5px;
  128. font-weight: 700;
  129. line-height: 15px;
  130. letter-spacing: 1.3px;
  131. text-transform: uppercase;
  132. margin-bottom: -1rem;
  133. }
  134. }
  135. .back-button {
  136. text-decoration: none;
  137. color: var(--on-neutral-color);
  138. font-size: 0.9rem;
  139. font-weight: 700;
  140. line-height: 15px;
  141. letter-spacing: 1.8px;
  142. text-transform: uppercase;
  143. }
  144. .key-word {
  145. color: var(--on-neutral-color);
  146. font-size: 20px;
  147. font-weight: 500;
  148. line-height: 24px;
  149. }
  150. </style>