Missions.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <LayoutContainer>
  3. <div v-if="pending">
  4. <v-row class="justify-center progress">
  5. <v-progress-circular
  6. indeterminate
  7. color="grey"
  8. />
  9. </v-row>
  10. </div>
  11. <div
  12. v-else
  13. v-for="(job, index) in jobs"
  14. :key="index"
  15. class="mission-container"
  16. >
  17. <v-row class="title-container">
  18. <NuxtLink
  19. :to="`/nous-rejoindre/${job.id}`"
  20. class="title"
  21. >
  22. {{ job.title }} - {{ job.contractType }}
  23. <v-icon
  24. v-if="job.featured"
  25. class="star fas fa-star"
  26. />
  27. </NuxtLink>
  28. <v-btn
  29. :to="`/nous-rejoindre/${job.id}`"
  30. class="btn-more"
  31. >
  32. En savoir plus
  33. </v-btn>
  34. </v-row>
  35. <v-row class="location-container">
  36. <v-icon icon="fas fa-map-marker" />
  37. <div class="location">
  38. {{ job.city }}
  39. </div>
  40. </v-row>
  41. </div>
  42. <v-row>
  43. <v-col cols="12">
  44. <v-pagination
  45. v-if="lastPage"
  46. :model-value="page"
  47. :length="lastPage"
  48. rounded="circle"
  49. max="10"
  50. @update:model-value="pageUpdated"
  51. />
  52. </v-col>
  53. </v-row>
  54. <v-row class="ml-6 mb-6">
  55. <v-col cols="12">
  56. <p class="apply-now">
  57. Nous sommes toujours à la recherche de nouveaux talents. N'hésitez pas
  58. à déposer votre candidature ci-dessous :
  59. </p>
  60. </v-col>
  61. </v-row>
  62. <v-row>
  63. <v-col cols="12">
  64. <v-btn
  65. class="btn-send"
  66. @click="dialog = true"
  67. >
  68. Envoyer ma candidature
  69. </v-btn>
  70. </v-col>
  71. </v-row>
  72. <!-- Boite de dialogue "soumettre une candidature" -->
  73. <v-dialog
  74. v-model="dialog"
  75. max-width="600px"
  76. >
  77. <v-card>
  78. <v-card-title
  79. class="text-center"
  80. >
  81. Formulaire de Candidature
  82. </v-card-title>
  83. <v-card-text>
  84. <v-form>
  85. <v-text-field
  86. label="Nom*"
  87. required
  88. />
  89. <v-text-field
  90. label="Prénom*"
  91. required
  92. />
  93. <v-text-field
  94. label="Téléphone*"
  95. required
  96. />
  97. <v-text-field
  98. label="Email*"
  99. required
  100. />
  101. <v-file-input
  102. label="Dépôt de CV*"
  103. accept=".pdf, .jpeg, .png"
  104. required
  105. />
  106. <v-file-input
  107. label="Dépôt de lettre de motivation"
  108. accept=".pdf, .jpeg, .png"
  109. />
  110. <v-textarea
  111. label="Message*"
  112. required
  113. />
  114. </v-form>
  115. </v-card-text>
  116. <p class="text-right mr-6">
  117. * Champs obligatoires
  118. </p>
  119. <v-card-actions class="justify-center">
  120. <v-btn
  121. class="btn-more mb-4"
  122. @click="sendApplication"
  123. >
  124. Envoyer
  125. </v-btn>
  126. </v-card-actions>
  127. </v-card>
  128. </v-dialog>
  129. </LayoutContainer>
  130. </template>
  131. <script setup lang="ts">
  132. import { useEntityFetch } from "~/composables/data/useEntityFetch";
  133. import JobPosting from "~/models/Maestro/JobPosting";
  134. import type { AnyJson } from "~/types/data";
  135. const i18n = useI18n();
  136. const router = useRouter()
  137. const { fetchCollection } = useEntityFetch()
  138. const page: Ref<number> = ref(1);
  139. const query: ComputedRef<AnyJson> = computed(() => {
  140. return { type: "ENTREPRISE", page: page.value }
  141. }
  142. )
  143. const { data: jobCollection, pending, refresh } = fetchCollection(
  144. JobPosting,
  145. null,
  146. query
  147. )
  148. // TODO: voir pourquoi on se retrouve obligé de passer par ce computed pour avoir le type TS correct?
  149. const jobs: ComputedRef<JobPosting[]> = computed(() => {
  150. return jobCollection.value !== null ?
  151. jobCollection.value.items as JobPosting[] :
  152. []
  153. })
  154. const lastPage: ComputedRef<number | null> = computed(() => {
  155. return jobCollection.value !== null && jobCollection.value.pagination ?
  156. jobCollection.value.pagination.last ?? null :
  157. null
  158. })
  159. const pageUpdated = async (newVal: number): Promise<void> => {
  160. page.value = newVal
  161. pending.value = true
  162. await refresh()
  163. // TODO: remplacer par un watcher sur pending?
  164. setTimeout(
  165. async () => await navigateTo({ path: '', hash: '#join-us-anchor' }),
  166. 200
  167. )
  168. }
  169. /**
  170. * Faut-il afficher la boite de dialogue de candidature
  171. */
  172. const dialog = ref(false);
  173. /**
  174. * Soumet le formulaire de candidature (boite de dialogue)
  175. */
  176. const sendApplication = () => {
  177. // TODO: implémenter le submit
  178. dialog.value = false;
  179. };
  180. </script>
  181. <style scoped lang="scss">
  182. .progress {
  183. margin: 32px auto 128px auto;
  184. }
  185. .v-btn {
  186. font-weight: 600;
  187. height: 50px;
  188. background: var(--secondary-color);
  189. border-radius: 6px;
  190. color: var(--on-secondary-color);
  191. gap: 9px;
  192. }
  193. .mission-container {
  194. margin: 64px 12%;
  195. .title-container {
  196. display: flex;
  197. justify-content: space-between;
  198. align-items: center;
  199. background: var(--primary-color);
  200. color: var(--on-primary-color);
  201. height: 80px;
  202. padding: 10px 10px 10px 1px;
  203. .title {
  204. font-family: "Barlow",serif;
  205. font-style: normal;
  206. font-weight: 600;
  207. font-size: 1.5rem;
  208. line-height: 39px;
  209. color: #ffffff;
  210. text-decoration: none;
  211. margin-left: 36px;
  212. }
  213. .star {
  214. margin-left: 12px;
  215. font-size: 24px;
  216. color: yellow;
  217. vertical-align: baseline;
  218. }
  219. .btn-more {
  220. margin-right: 8px;
  221. display: flex;
  222. align-items: center;
  223. }
  224. }
  225. .location-container {
  226. background: #9edbdd;
  227. display: flex;
  228. align-items: center;
  229. padding: 10px;
  230. .v-icon {
  231. font-size: 1rem !important;
  232. color: #0e2d32;
  233. }
  234. .location {
  235. color: var(--primary-color);
  236. margin-left: 10px;
  237. font-size: 1.3rem;
  238. }
  239. }
  240. }
  241. @media (max-width: 600px) {
  242. .mission-container {
  243. margin: 64px 6%;
  244. }
  245. }
  246. .btn-send {
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. width: 30%;
  251. margin-left: auto;
  252. margin-right: auto;
  253. font-weight: 700;
  254. }
  255. .apply-now {
  256. text-align: center;
  257. font-style: italic;
  258. font-weight: 300;
  259. font-size: 34px;
  260. line-height: 40px;
  261. color: #091d20;
  262. margin-bottom: 2rem;
  263. }
  264. .v-dialog {
  265. font-family: Barlow, serif;
  266. .btn-more {
  267. width: 128px;
  268. }
  269. }
  270. </style>