Missions.vue 5.6 KB

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