Missions.client.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. </script>
  100. <style scoped lang="scss">
  101. .progress {
  102. margin: 32px auto 128px auto;
  103. }
  104. .v-btn {
  105. font-weight: 600;
  106. height: 50px;
  107. border-radius: 6px;
  108. color: var(--on-neutral-color);
  109. gap: 9px;
  110. }
  111. .v-btn:hover {
  112. background-color: var(--on-neutral-color-extra-light);
  113. }
  114. .mission-container {
  115. margin: 64px 12%;
  116. .title-container {
  117. display: flex;
  118. justify-content: space-between;
  119. align-items: center;
  120. background: var(--primary-color);
  121. color: var(--on-primary-color);
  122. height: 80px;
  123. padding: 10px 10px 10px 1px;
  124. @media (max-width: 600px) {
  125. flex-direction: column;
  126. height: auto;
  127. }
  128. .title {
  129. font-weight: 600;
  130. font-size: 1.5rem;
  131. line-height: 39px;
  132. color: var(--on-primary-color);
  133. text-decoration: none;
  134. margin-left: 36px;
  135. @media (max-width: 600px) {
  136. font-size: 1.2rem;
  137. margin-left: auto;
  138. margin-right: auto;
  139. width: 90%;
  140. }
  141. }
  142. .star {
  143. margin-left: 12px;
  144. font-size: 24px;
  145. color: yellow;
  146. vertical-align: baseline;
  147. }
  148. .btn-more {
  149. margin-right: 8px;
  150. display: flex;
  151. align-items: center;
  152. @media (max-width: 600px) {
  153. margin: 12px auto;
  154. }
  155. }
  156. }
  157. .location-container {
  158. background: var(--secondary-color);
  159. display: flex;
  160. align-items: center;
  161. padding: 10px;
  162. .v-icon {
  163. font-size: 1rem !important;
  164. color: var(--primary-color);
  165. }
  166. .location {
  167. color: var(--primary-color);
  168. margin-left: 10px;
  169. font-size: 1.3rem;
  170. }
  171. @media (max-width: 600px) {
  172. margin: 0 auto 12px auto;
  173. }
  174. }
  175. }
  176. @media (max-width: 600px) {
  177. .mission-container {
  178. margin: 64px 6%;
  179. }
  180. }
  181. .btn-send {
  182. display: flex;
  183. justify-content: center;
  184. align-items: center;
  185. width: 30%;
  186. margin-left: auto;
  187. margin-right: auto;
  188. font-weight: 700;
  189. background-color: var(--secondary-color);
  190. @media (max-width: 600px) {
  191. width: 80%;
  192. margin: 12px auto;
  193. }
  194. }
  195. .apply-now {
  196. text-align: center;
  197. font-style: italic;
  198. font-weight: 300;
  199. font-size: 1.5rem;
  200. line-height: 40px;
  201. color: var(--primary-color);
  202. margin-bottom: 2rem;
  203. margin-left: 24px;
  204. @media (max-width: 600px) {
  205. max-width: 90%;
  206. margin: 12px auto;
  207. }
  208. }
  209. </style>