Missions.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. <LayoutPagination
  45. v-if="jobCollection && jobCollection.pagination"
  46. :model-value="page"
  47. :pagination="jobCollection.pagination"
  48. @update:model-value="onPageUpdated"
  49. class="mt-4"
  50. />
  51. </v-col>
  52. </v-row>
  53. <v-row class="ml-6 mb-6">
  54. <v-col cols="12">
  55. <p class="apply-now">
  56. Nous sommes toujours à la recherche de nouveaux talents. N'hésitez pas
  57. à déposer votre candidature ci-dessous :
  58. </p>
  59. </v-col>
  60. </v-row>
  61. <v-row>
  62. <v-col cols="12">
  63. <v-btn
  64. class="btn-send"
  65. @click="dialog = true"
  66. >
  67. Envoyer ma candidature
  68. </v-btn>
  69. </v-col>
  70. </v-row>
  71. <!-- Boite de dialogue "soumettre une candidature" -->
  72. <v-dialog
  73. v-model="dialog"
  74. max-width="600px"
  75. >
  76. <v-card>
  77. <v-card-title
  78. class="text-center"
  79. >
  80. Formulaire de Candidature
  81. </v-card-title>
  82. <v-card-text>
  83. <v-form>
  84. <v-text-field
  85. label="Nom*"
  86. required
  87. />
  88. <v-text-field
  89. label="Prénom*"
  90. required
  91. />
  92. <v-text-field
  93. label="Téléphone*"
  94. required
  95. />
  96. <v-text-field
  97. label="Email*"
  98. required
  99. />
  100. <v-file-input
  101. label="Dépôt de CV*"
  102. accept=".pdf, .jpeg, .png"
  103. required
  104. />
  105. <v-file-input
  106. label="Dépôt de lettre de motivation"
  107. accept=".pdf, .jpeg, .png"
  108. />
  109. <v-textarea
  110. label="Message*"
  111. required
  112. />
  113. </v-form>
  114. </v-card-text>
  115. <p class="text-right mr-6">
  116. * Champs obligatoires
  117. </p>
  118. <v-card-actions class="justify-center">
  119. <v-btn
  120. class="btn-more mb-4"
  121. @click="sendApplication"
  122. >
  123. Envoyer
  124. </v-btn>
  125. </v-card-actions>
  126. </v-card>
  127. </v-dialog>
  128. </LayoutContainer>
  129. </template>
  130. <script setup lang="ts">
  131. import { useEntityFetch } from "~/composables/data/useEntityFetch";
  132. import JobPosting from "~/models/Maestro/JobPosting";
  133. import { ComputedRef } from "vue";
  134. import { 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 onPageUpdated = async (newVal: number): Promise<void> => {
  155. page.value = newVal
  156. pending.value = true
  157. await refresh()
  158. // TODO: remplacer par un watcher sur pending?
  159. setTimeout(
  160. async () => await navigateTo({ path: '', hash: '#join-us-anchor' }),
  161. 200
  162. )
  163. }
  164. /**
  165. * Faut-il afficher la boite de dialogue de candidature
  166. */
  167. const dialog = ref(false);
  168. /**
  169. * Soumet le formulaire de candidature (boite de dialogue)
  170. */
  171. const sendApplication = () => {
  172. // TODO: implémenter le submit
  173. dialog.value = false;
  174. };
  175. </script>
  176. <style scoped lang="scss">
  177. .progress {
  178. margin: 32px auto 128px auto;
  179. }
  180. .v-btn {
  181. font-weight: 600;
  182. height: 50px;
  183. background: var(--secondary-color);
  184. border-radius: 6px;
  185. color: var(--on-secondary-color);
  186. gap: 9px;
  187. }
  188. .mission-container {
  189. margin: 64px 12%;
  190. .title-container {
  191. display: flex;
  192. justify-content: space-between;
  193. align-items: center;
  194. background: var(--primary-color);
  195. color: var(--on-primary-color);
  196. height: 80px;
  197. padding: 10px 10px 10px 1px;
  198. .title {
  199. font-family: "Barlow",serif;
  200. font-style: normal;
  201. font-weight: 600;
  202. font-size: 1.5rem;
  203. line-height: 39px;
  204. color: #ffffff;
  205. text-decoration: none;
  206. margin-left: 36px;
  207. }
  208. .star {
  209. margin-left: 12px;
  210. font-size: 24px;
  211. color: yellow;
  212. vertical-align: baseline;
  213. }
  214. .btn-more {
  215. margin-right: 8px;
  216. display: flex;
  217. align-items: center;
  218. }
  219. }
  220. .location-container {
  221. background: #9edbdd;
  222. display: flex;
  223. align-items: center;
  224. padding: 10px;
  225. .v-icon {
  226. font-size: 1rem !important;
  227. color: #0e2d32;
  228. }
  229. .location {
  230. color: var(--primary-color);
  231. margin-left: 10px;
  232. font-size: 1.3rem;
  233. }
  234. }
  235. }
  236. @media (max-width: 600px) {
  237. .mission-container {
  238. margin: 64px 6%;
  239. }
  240. }
  241. .btn-send {
  242. display: flex;
  243. justify-content: center;
  244. align-items: center;
  245. width: 30%;
  246. margin-left: auto;
  247. margin-right: auto;
  248. font-weight: 700;
  249. }
  250. .apply-now {
  251. text-align: center;
  252. font-style: italic;
  253. font-weight: 300;
  254. font-size: 34px;
  255. line-height: 40px;
  256. color: #091d20;
  257. margin-bottom: 2rem;
  258. }
  259. .v-dialog {
  260. font-family: Barlow, serif;
  261. .btn-more {
  262. width: 128px;
  263. }
  264. }
  265. </style>