Missions.client.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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="
  34. jobCollection &&
  35. jobCollection.pagination &&
  36. jobCollection.pagination.last > 1
  37. "
  38. :model-value="page"
  39. :pagination="jobCollection.pagination"
  40. class="mt-4"
  41. @update:model-value="onPageUpdated"
  42. />
  43. </v-col>
  44. </v-row>
  45. <v-row class="mb-6">
  46. <v-col cols="12">
  47. <p class="apply-now">
  48. Nous sommes toujours à la recherche de nouveaux talents.<br />
  49. N'hésitez pas à déposer votre candidature ci-dessous :
  50. </p>
  51. </v-col>
  52. </v-row>
  53. <v-row>
  54. <v-col cols="12">
  55. <v-btn class="btn-send" @click="dialog = true">
  56. Envoyer ma candidature
  57. </v-btn>
  58. </v-col>
  59. </v-row>
  60. <!-- Boite de dialogue "soumettre une candidature" -->
  61. <JoinUsDialog v-model="dialog" />
  62. </LayoutContainer>
  63. </template>
  64. <script setup lang="ts">
  65. import type { ComputedRef, Ref } from 'vue'
  66. import { useEntityFetch } from '~/composables/data/useEntityFetch'
  67. import JobPosting from '~/models/Maestro/JobPosting'
  68. import type { AnyJson } from '~/types/data'
  69. const { fetchCollection } = useEntityFetch()
  70. const page: Ref<number> = ref(1)
  71. const query: ComputedRef<AnyJson> = computed(() => {
  72. return { type: 'BUSINESS', page: page.value }
  73. })
  74. const {
  75. data: jobCollection,
  76. pending,
  77. refresh,
  78. } = fetchCollection(JobPosting, null, query)
  79. // TODO: voir pourquoi on se retrouve obligé de passer par ce computed pour avoir le type TS correct?
  80. const jobs: ComputedRef<JobPosting[]> = computed(() => {
  81. return jobCollection.value !== null
  82. ? (jobCollection.value.items as JobPosting[])
  83. : []
  84. })
  85. const onPageUpdated = async (newVal: number): Promise<void> => {
  86. page.value = newVal
  87. pending.value = true
  88. await refresh()
  89. // TODO: remplacer par un watcher sur pending?
  90. setTimeout(
  91. async () => await navigateTo({ path: '', hash: '#join-us-anchor' }),
  92. 200
  93. )
  94. }
  95. /**
  96. * Faut-il afficher la boite de dialogue de candidature
  97. */
  98. const dialog = ref(false)
  99. const onFormSubmit = () => {
  100. jobApplicationSent.value = true
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .progress {
  105. margin: 32px auto 128px auto;
  106. }
  107. .v-btn {
  108. font-weight: 600;
  109. height: 50px;
  110. border-radius: 6px;
  111. color: var(--on-neutral-color);
  112. gap: 9px;
  113. }
  114. .v-btn:hover {
  115. background-color: var(--on-neutral-color-extra-light);
  116. }
  117. .mission-container {
  118. margin: 64px 12%;
  119. .title-container {
  120. display: flex;
  121. justify-content: space-between;
  122. align-items: center;
  123. background: var(--primary-color);
  124. color: var(--on-primary-color);
  125. height: 80px;
  126. padding: 10px 10px 10px 1px;
  127. @media (max-width: 600px) {
  128. flex-direction: column;
  129. height: auto;
  130. }
  131. .title {
  132. font-weight: 600;
  133. font-size: 1.5rem;
  134. line-height: 39px;
  135. color: var(--on-primary-color);
  136. text-decoration: none;
  137. margin-left: 36px;
  138. @media (max-width: 600px) {
  139. font-size: 1.2rem;
  140. margin-left: auto;
  141. margin-right: auto;
  142. width: 90%;
  143. }
  144. }
  145. .star {
  146. margin-left: 12px;
  147. font-size: 24px;
  148. color: yellow;
  149. vertical-align: baseline;
  150. }
  151. .btn-more {
  152. margin-right: 8px;
  153. display: flex;
  154. align-items: center;
  155. @media (max-width: 600px) {
  156. margin: 12px auto;
  157. }
  158. }
  159. }
  160. .location-container {
  161. background: var(--secondary-color);
  162. display: flex;
  163. align-items: center;
  164. padding: 10px;
  165. .v-icon {
  166. font-size: 1rem !important;
  167. color: var(--primary-color);
  168. }
  169. .location {
  170. color: var(--primary-color);
  171. margin-left: 10px;
  172. font-size: 1.3rem;
  173. }
  174. @media (max-width: 600px) {
  175. margin: 0 auto 12px auto;
  176. }
  177. }
  178. }
  179. @media (max-width: 600px) {
  180. .mission-container {
  181. margin: 64px 6%;
  182. }
  183. }
  184. .btn-send {
  185. display: flex;
  186. justify-content: center;
  187. align-items: center;
  188. width: 30%;
  189. margin-left: auto;
  190. margin-right: auto;
  191. font-weight: 700;
  192. background-color: var(--secondary-color);
  193. @media (max-width: 600px) {
  194. width: 80%;
  195. margin: 12px auto;
  196. }
  197. }
  198. .apply-now {
  199. text-align: center;
  200. font-style: italic;
  201. font-weight: 300;
  202. font-size: 1.5rem;
  203. line-height: 40px;
  204. color: var(--primary-color);
  205. margin-bottom: 2rem;
  206. margin-left: 24px;
  207. @media (max-width: 600px) {
  208. max-width: 90%;
  209. margin: 12px auto;
  210. }
  211. }
  212. </style>