Details.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 custom-row">
  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="custom-row">
  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="custom-row">
  45. <p class="description">
  46. <!-- TODO: idem que pour les annonces -->
  47. {{ newsItem.bodyText }}
  48. </p>
  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 custom-row">
  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 custom-row">
  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. .custom-row {
  96. width: 90%;
  97. margin-left: auto;
  98. margin-right: auto;
  99. }
  100. .news {
  101. .v-img {
  102. width: 80%;
  103. margin-left: 3.5rem;
  104. margin-right: auto;
  105. }
  106. h4 {
  107. margin-top: 11rem;
  108. text-decoration: none;
  109. text-transform: uppercase;
  110. font-family: Barlow, serif;
  111. font-size: 36px;
  112. font-style: normal;
  113. font-weight: 600;
  114. }
  115. .description {
  116. color: #0e2d32;
  117. text-align: justify;
  118. font-family: "Barlow", serif;
  119. font-size: 30px;
  120. font-style: normal;
  121. font-weight: 500;
  122. line-height: 34px;
  123. margin-left: 3.5rem;
  124. margin-right: 3.5rem;
  125. margin-bottom: 3rem;
  126. }
  127. .btn-plus {
  128. background: var(--secondary-color);
  129. color: var(--on-secondary-color);
  130. display: flex;
  131. left: 0;
  132. padding: 25px 28px;
  133. align-items: center;
  134. gap: 9px;
  135. font-family: Barlow, serif;
  136. font-size: 0.9rem;
  137. border-radius: 5px;
  138. font-style: normal;
  139. font-weight: 700;
  140. line-height: 15px;
  141. letter-spacing: 1.3px;
  142. text-transform: uppercase;
  143. margin-bottom: -1rem;
  144. }
  145. }
  146. .back-button {
  147. text-decoration: none;
  148. color: #000000;
  149. font-family: Barlow, serif;
  150. font-size: 0.9rem;
  151. font-style: normal;
  152. font-weight: 700;
  153. line-height: 15px;
  154. letter-spacing: 1.8px;
  155. text-transform: uppercase;
  156. }
  157. .key-word {
  158. color: #000;
  159. font-family: Barlow, serif;
  160. font-size: 20px;
  161. font-style: normal;
  162. font-weight: 500;
  163. line-height: 24px;
  164. }
  165. </style>