Missions.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <LayoutContainer>
  3. <div v-for="(job, index) in jobs" :key="index" class="mission-container">
  4. <!-- Première ligne avec alignement vertical -->
  5. <v-row class="announcement-title ml-6 mr-6 d-flex align-center">
  6. <NuxtLink
  7. :to="`/nous-rejoindre/${job.id}`"
  8. class="text-decoration-none"
  9. >
  10. <div class="title-job ml-4">
  11. <!-- Icône étoile pour les annonces 'featured' -->
  12. {{ job.title }} - {{ job.contractType }}
  13. <v-icon
  14. v-if="job.featured"
  15. class="fas fa-star"
  16. style="color: yellow"
  17. ></v-icon>
  18. </div>
  19. </NuxtLink>
  20. <NuxtLink
  21. :to="`/nous-rejoindre/${job.id}`"
  22. class="text-decoration-none d-flex align-center"
  23. >
  24. <v-icon class="mr-2"> </v-icon>
  25. <v-btn class="btn-more mr-4" text>
  26. En savoir plus
  27. </v-btn>
  28. </NuxtLink>
  29. </v-row>
  30. <v-row class="announcement-location ml-6 mr-6">
  31. <v-icon class="icon-location">
  32. <i class="fas fa-map-marker"></i>
  33. </v-icon>
  34. <div class="location">
  35. {{ job.city }}
  36. </div>
  37. </v-row>
  38. </div>
  39. <v-row class="apply-row ml-6 mb-6">
  40. <v-col cols="12">
  41. <p class="apply-now">
  42. Nous sommes toujours à la recherche de nouveaux talents. N'hésitez pas
  43. à déposer votre candidature ci-dessous :
  44. </p>
  45. </v-col>
  46. </v-row>
  47. <v-row>
  48. <v-col cols="12">
  49. <v-btn class="btn-send" @click="dialog = true">
  50. Envoyer ma candidature
  51. </v-btn>
  52. </v-col>
  53. </v-row>
  54. <v-dialog v-model="dialog" max-width="600px">
  55. <v-card>
  56. <v-card-title class="text-center" style="font-family: Barlow">
  57. Formulaire de Candidature
  58. </v-card-title>
  59. <v-card-text>
  60. <v-form>
  61. <v-text-field label="Nom*" required></v-text-field>
  62. <v-text-field label="Prénom*" required></v-text-field>
  63. <v-text-field label="Téléphone*" required></v-text-field>
  64. <v-text-field label="Email*" required></v-text-field>
  65. <v-file-input
  66. label="Dépôt de CV*"
  67. accept=".pdf, .jpeg, .png"
  68. required
  69. ></v-file-input>
  70. <v-file-input
  71. label="Dépôt de lettre de motivation"
  72. accept=".pdf, .jpeg, .png"
  73. ></v-file-input>
  74. <v-textarea label="Message*" required></v-textarea>
  75. </v-form>
  76. </v-card-text>
  77. <p class="text-right mr-6">* Champs obligatoires</p>
  78. <v-card-actions>
  79. <v-btn class="btn-more" @click="sendApplication">Envoyer</v-btn>
  80. </v-card-actions>
  81. </v-card>
  82. </v-dialog>
  83. </LayoutContainer>
  84. </template>
  85. <script setup lang="ts">
  86. import { ref } from "vue";
  87. import { useMaestroRequestService } from "~/composables/useMaestroRequestService";
  88. const { apiRequestService } = useMaestroRequestService();
  89. const dialog = ref(false);
  90. const sendApplication = () => {
  91. console.log("Formulaire envoyé");
  92. dialog.value = false;
  93. };
  94. const query = computed(() => {
  95. const queryParams: {
  96. page: number;
  97. type?: string;
  98. [key: string]: number | string;
  99. } = {
  100. page: page.value,
  101. type: "ENTREPRISE",
  102. };
  103. return queryParams;
  104. });
  105. const totalItems = ref(0);
  106. const config = useRuntimeConfig();
  107. const baseUrl = `${config.public.apiBaseUrl}/api/job-postings`;
  108. const page: Ref<number> = ref(1);
  109. const itemsPerPage: Ref<number> = ref(10);
  110. const { t } = useI18n();
  111. const {
  112. data: jobs = [],
  113. pending,
  114. refresh,
  115. } = useLazyAsyncData("files", async () => {
  116. const response = await apiRequestService.get(baseUrl, query.value);
  117. const collection = response["hydra:member"];
  118. const currentDate = new Date();
  119. // Séparer les annonces 'featured'
  120. const featuredJobs = collection.filter(
  121. (item) => item.featured && new Date(item.startPublication) <= currentDate
  122. );
  123. // Filtrer et trier les autres annonces
  124. const regularJobs = collection.filter((item) => {
  125. const startPublicationDate = new Date(item.startPublication);
  126. const endPublicationDate = new Date(item.endPublication);
  127. return (
  128. !item.featured &&
  129. startPublicationDate <= currentDate &&
  130. endPublicationDate >= currentDate
  131. );
  132. });
  133. // Combinez les annonces 'featured' et les autres annonces
  134. const combinedJobs = [...featuredJobs, ...regularJobs];
  135. totalItems.value = combinedJobs.length;
  136. console.log(combinedJobs);
  137. return combinedJobs;
  138. });
  139. </script>
  140. <style scoped>
  141. .location {
  142. font-size: 1.3rem !important;
  143. color: #0e2d32;
  144. }
  145. .announcement-title {
  146. background: #0e2d32;
  147. color: white;
  148. display: flex;
  149. justify-content: space-between;
  150. height: 80px;
  151. padding: 10px 10px 10px 1;
  152. }
  153. .title-job {
  154. font-family: "Barlow";
  155. font-style: normal;
  156. font-weight: 600;
  157. font-size: 1.5rem;
  158. line-height: 39px;
  159. color: #ffffff;
  160. }
  161. .btn-more,
  162. .btn-send {
  163. font-weight: 600;
  164. height: 50px;
  165. background: #64afb7;
  166. border-radius: 6px;
  167. color: white;
  168. gap: 9px;
  169. }
  170. .btn-send {
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. width: 30%;
  175. margin-left: auto;
  176. margin-right: auto;
  177. font-weight: 700;
  178. }
  179. .announcement-location {
  180. background: #9edbdd;
  181. display: flex;
  182. align-items: center;
  183. padding: 10px;
  184. }
  185. .icon-location {
  186. font-size: 1rem !important;
  187. color: #0e2d32;
  188. }
  189. .location {
  190. margin-left: 10px;
  191. font-size: 2rem;
  192. }
  193. .apply-now {
  194. text-align: center;
  195. font-style: italic;
  196. font-weight: 300;
  197. font-size: 34px;
  198. line-height: 40px;
  199. color: #091d20;
  200. margin-bottom: 2rem;
  201. }
  202. .mission-container {
  203. margin-top: 3rem;
  204. margin-bottom: 5%;
  205. }
  206. </style>