Missions.client.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <LayoutContainer>
  3. <div v-if="pending">
  4. <v-row class="justify-center progress">
  5. <v-progress-circular indeterminate color="grey" />
  6. </v-row>
  7. </div>
  8. <div
  9. v-for="(job, index) in jobs"
  10. v-else
  11. :key="index"
  12. class="mission-container"
  13. >
  14. <div class="title-container">
  15. <NuxtLink :to="`/nous-rejoindre/${job.id}`" class="title">
  16. {{ job.title }} - {{ $t(job.contractType) }}
  17. <v-icon v-if="job.featured" class="star fas fa-star" />
  18. </NuxtLink>
  19. <v-btn :to="`/nous-rejoindre/${job.id}`" class="btn-more">
  20. En savoir plus
  21. </v-btn>
  22. </div>
  23. <div class="location-container">
  24. <v-icon icon="fas fa-map-marker" />
  25. <div class="location">
  26. {{ job.city }}
  27. </div>
  28. </div>
  29. </div>
  30. <v-row>
  31. <v-col cols="12">
  32. <LayoutPagination
  33. v-if="jobCollection && jobCollection.pagination"
  34. :model-value="page"
  35. :pagination="jobCollection.pagination"
  36. class="mt-4"
  37. @update:model-value="onPageUpdated"
  38. />
  39. </v-col>
  40. </v-row>
  41. <v-row class="mb-6">
  42. <v-col cols="12">
  43. <p class="apply-now">
  44. Nous sommes toujours à la recherche de nouveaux talents.<br />
  45. N'hésitez pas à déposer votre candidature ci-dessous :
  46. </p>
  47. </v-col>
  48. </v-row>
  49. <v-row>
  50. <v-col cols="12">
  51. <v-btn class="btn-send" @click="dialog = true">
  52. Envoyer ma candidature
  53. </v-btn>
  54. </v-col>
  55. </v-row>
  56. <!-- Boite de dialogue "soumettre une candidature" -->
  57. <v-dialog
  58. v-model="dialog"
  59. max-width="600px"
  60. :persistent="!jobApplicationSent"
  61. no-click-animation
  62. :retain-focus="false"
  63. >
  64. <div v-if="!jobApplicationSent">
  65. <JoinUsForm @submit="onFormSubmit" />
  66. <v-btn @click="dialog = false"> Annuler </v-btn>
  67. </div>
  68. <div v-else>
  69. <v-card class="pa-6 text-center">
  70. Votre candidature a bien été envoyée, merci de votre intérêt.<br />
  71. Nous vous recontacterons dès que possible.
  72. </v-card>
  73. <v-btn @click="dialog = false"> Fermer </v-btn>
  74. </div>
  75. </v-dialog>
  76. </LayoutContainer>
  77. </template>
  78. <script setup lang="ts">
  79. import type { ComputedRef, Ref } from 'vue'
  80. import { useEntityFetch } from '~/composables/data/useEntityFetch'
  81. import JobPosting from '~/models/Maestro/JobPosting'
  82. import type { AnyJson } from '~/types/data'
  83. const { fetchCollection } = useEntityFetch()
  84. const page: Ref<number> = ref(1)
  85. const query: ComputedRef<AnyJson> = computed(() => {
  86. return { type: 'BUSINESS', page: page.value }
  87. })
  88. const {
  89. data: jobCollection,
  90. pending,
  91. refresh,
  92. } = fetchCollection(JobPosting, null, query)
  93. // TODO: voir pourquoi on se retrouve obligé de passer par ce computed pour avoir le type TS correct?
  94. const jobs: ComputedRef<JobPosting[]> = computed(() => {
  95. return jobCollection.value !== null
  96. ? (jobCollection.value.items as JobPosting[])
  97. : []
  98. })
  99. const onPageUpdated = async (newVal: number): Promise<void> => {
  100. page.value = newVal
  101. pending.value = true
  102. await refresh()
  103. // TODO: remplacer par un watcher sur pending?
  104. setTimeout(
  105. async () => await navigateTo({ path: '', hash: '#join-us-anchor' }),
  106. 200
  107. )
  108. }
  109. /**
  110. * Faut-il afficher la boite de dialogue de candidature
  111. */
  112. const dialog = ref(false)
  113. const jobApplicationSent: Ref<boolean> = ref(false)
  114. const onFormSubmit = () => {
  115. jobApplicationSent.value = true
  116. }
  117. </script>
  118. <style scoped lang="scss">
  119. .progress {
  120. margin: 32px auto 128px auto;
  121. }
  122. .v-btn {
  123. font-weight: 600;
  124. height: 50px;
  125. border-radius: 6px;
  126. color: var(--on-neutral-color);
  127. gap: 9px;
  128. }
  129. .v-btn:hover {
  130. background-color: var(--on-neutral-color-extra-light);
  131. }
  132. .mission-container {
  133. margin: 64px 12%;
  134. .title-container {
  135. display: flex;
  136. justify-content: space-between;
  137. align-items: center;
  138. background: var(--primary-color);
  139. color: var(--on-primary-color);
  140. height: 80px;
  141. padding: 10px 10px 10px 1px;
  142. @media (max-width: 600px) {
  143. flex-direction: column;
  144. height: auto;
  145. }
  146. .title {
  147. font-weight: 600;
  148. font-size: 1.5rem;
  149. line-height: 39px;
  150. color: var(--on-primary-color);
  151. text-decoration: none;
  152. margin-left: 36px;
  153. @media (max-width: 600px) {
  154. font-size: 1.2rem;
  155. margin-left: auto;
  156. margin-right: auto;
  157. width: 90%;
  158. }
  159. }
  160. .star {
  161. margin-left: 12px;
  162. font-size: 24px;
  163. color: yellow;
  164. vertical-align: baseline;
  165. }
  166. .btn-more {
  167. margin-right: 8px;
  168. display: flex;
  169. align-items: center;
  170. @media (max-width: 600px) {
  171. margin: 12px auto;
  172. }
  173. }
  174. }
  175. .location-container {
  176. background: var(--secondary-color);
  177. display: flex;
  178. align-items: center;
  179. padding: 10px;
  180. .v-icon {
  181. font-size: 1rem !important;
  182. color: var(--primary-color);
  183. }
  184. .location {
  185. color: var(--primary-color);
  186. margin-left: 10px;
  187. font-size: 1.3rem;
  188. }
  189. @media (max-width: 600px) {
  190. margin: 0 auto 12px auto;
  191. }
  192. }
  193. }
  194. @media (max-width: 600px) {
  195. .mission-container {
  196. margin: 64px 6%;
  197. }
  198. }
  199. .btn-send {
  200. display: flex;
  201. justify-content: center;
  202. align-items: center;
  203. width: 30%;
  204. margin-left: auto;
  205. margin-right: auto;
  206. font-weight: 700;
  207. background-color: var(--secondary-color);
  208. @media (max-width: 600px) {
  209. width: 80%;
  210. margin: 12px auto;
  211. }
  212. }
  213. .apply-now {
  214. text-align: center;
  215. font-style: italic;
  216. font-weight: 300;
  217. font-size: 1.5rem;
  218. line-height: 40px;
  219. color: var(--primary-color);
  220. margin-bottom: 2rem;
  221. margin-left: 24px;
  222. @media (max-width: 600px) {
  223. max-width: 90%;
  224. margin: 12px auto;
  225. }
  226. }
  227. .v-dialog {
  228. :deep(.v-overlay__content) {
  229. overflow: auto !important;
  230. }
  231. :deep(.v-card) {
  232. border-bottom-left-radius: 0;
  233. border-bottom-right-radius: 0;
  234. }
  235. .v-btn {
  236. width: 100%;
  237. border-top-left-radius: 0;
  238. border-top-right-radius: 0;
  239. }
  240. }
  241. </style>