_id.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <LayoutContainer>
  3. <header class="mb-4">
  4. <v-layout>
  5. <v-btn
  6. to="/structures"
  7. nuxt
  8. plain
  9. >
  10. <font-awesome-icon class="icon mr-1" :icon="['fas', 'chevron-left']" />
  11. {{ $t('go_back') }}
  12. </v-btn>
  13. </v-layout>
  14. </header>
  15. <v-container class="content">
  16. <v-layout class="flex-row align-center mb-4">
  17. <nuxt-img
  18. v-if="structure.logoId"
  19. :src="structure.logoId ? 'https://api.opentalent.fr/app.php/_internal/secure/files/' + structure.logoId + '/0x60' : '/images/default.jpg'"
  20. alt="logo"
  21. />
  22. <h2 class="flex mx-4 d-flex align-center">
  23. {{ structure.name }}
  24. </h2>
  25. <div class="d-flex flex-row align-center">
  26. <a v-if="structure.facebook" :href="structure.facebook" class="facebook" target="_blank" :title="$t('find_us_on') + ' Facebook'">
  27. <font-awesome-icon class="icon social-icon" :icon="['fab', 'facebook']" />
  28. </a>
  29. <a v-if="structure.instagram" :href="structure.instagram" class="instagram" target="_blank" :title="$t('find_us_on') + ' Instagram'">
  30. <font-awesome-icon class="icon social-icon" :icon="['fab', 'instagram-square']" />
  31. </a>
  32. <a v-if="structure.twitter" :href="structure.twitter" class="twitter" target="_blank" title="$t('find_us_on') + ' Twitter'">
  33. <font-awesome-icon class="icon social-icon" :icon="['fab', 'twitter']" />
  34. </a>
  35. </div>
  36. </v-layout>
  37. <v-row>
  38. <v-col cols="12">
  39. <nuxt-img src="/images/piano.jpg" alt="" class="max-w100" />
  40. </v-col>
  41. </v-row>
  42. <v-row>
  43. <v-col cols="12">
  44. <v-chip-group v-if="structure.practices" :max="0" active-class="primary--text" class="justify-center">
  45. <v-chip v-for="practice in structure.practices" :key="practice">
  46. {{ $t(practice) }}
  47. </v-chip>
  48. </v-chip-group>
  49. </v-col>
  50. </v-row>
  51. <v-divider class="my-2" />
  52. <v-row class="my-2 py-2">
  53. <v-col
  54. cols="12"
  55. sm="6"
  56. class="description"
  57. >
  58. <div class="d-flex flex-row mb-3">
  59. <h4>{{ $t('descriptive') }}</h4>
  60. <v-spacer />
  61. </div>
  62. <p class="pa-2">
  63. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
  64. dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
  65. ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
  66. eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
  67. deserunt mollit anim id est laborum.
  68. </p>
  69. </v-col>
  70. <v-col
  71. cols="12"
  72. sm="6"
  73. class="contact"
  74. >
  75. <div class="d-flex flex-row mb-3">
  76. <h4>{{ $t('contact') }}</h4>
  77. <v-spacer />
  78. </div>
  79. <table>
  80. <tr>
  81. <td>
  82. <font-awesome-icon class="icon" :icon="['fas', 'map-marker-alt']" />
  83. </td>
  84. <td class="mx-2">
  85. <span v-if="structure.streetAddress">{{ structure.streetAddress }}<br></span>
  86. <span v-if="structure.postalCode">{{ structure.postalCode }} </span>
  87. {{ structure.addressCity }}
  88. </td>
  89. </tr>
  90. <tr>
  91. <td>
  92. <font-awesome-icon class="icon" :icon="['fas', 'phone-alt']" />
  93. </td>
  94. <td class="phone">
  95. <div v-if="structure.telphone">
  96. <a v-if="showTel" :href="'tel:' + structure.telphone">{{ structure.telphone }}</a>
  97. <v-btn v-else small @click="showTel = 1">
  98. {{ $t('show_tel') }}
  99. </v-btn>
  100. </div>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td>
  105. <font-awesome-icon class="icon" :icon="['fas', 'at']" />
  106. </td>
  107. <td class="mail">
  108. <div v-if="structure.email">
  109. <a v-if="showMail" :href="'mailto:' + structure.email">{{ structure.email }}</a>
  110. <v-btn v-else small @click="showMail = 1">
  111. {{ $t('show_email') }}
  112. </v-btn>
  113. </div>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td>
  118. <font-awesome-icon class="icon" :icon="['fas', 'globe-europe']" />
  119. </td>
  120. <td class="website">
  121. <a :href="structure.website" target="_blank">{{ structure.website }}</a>
  122. </td>
  123. </tr>
  124. <tr>
  125. <td>
  126. <font-awesome-icon class="icon" :icon="['fas', 'project-diagram']" />
  127. </td>
  128. <td class="network">
  129. <NuxtLink :to="'/structures/' + structure.n1Id" nuxt>
  130. {{ structure.n1Name }}
  131. </NuxtLink>
  132. </td>
  133. </tr>
  134. </table>
  135. </v-col>
  136. </v-row>
  137. <v-row class="mb-4">
  138. <v-col cols="12">
  139. <v-btn small disabled>
  140. {{ $t('spot_on_from') }} 01/01/2021
  141. </v-btn>
  142. </v-col>
  143. </v-row>
  144. <v-row v-if="structure.latitude && structure.longitude">
  145. <v-col cols="12">
  146. <v-responsive width="100%" height="450px">
  147. <no-ssr>
  148. <l-map
  149. id="map"
  150. :zoom="13"
  151. :center="[structure.latitude, structure.longitude]"
  152. :options="{ scrollWheelZoom: false, zoomSnap: 0.25 }"
  153. >
  154. <l-tile-layer
  155. url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"
  156. attribution="&copy; <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"
  157. />
  158. <l-marker
  159. :key="structure.id"
  160. :lat-lng="[structure.latitude, structure.longitude]"
  161. >
  162. <l-popup>
  163. <b>{{ structure.name }}</b><br>
  164. {{ structure.postalCode }} {{ structure.addressCity }}<br>
  165. <a :href="structure.website" target="_blank">{{ structure.website }}</a>
  166. </l-popup>
  167. </l-marker>
  168. </l-map>
  169. </no-ssr>
  170. </v-responsive>
  171. </v-col>
  172. </v-row>
  173. </v-container>
  174. </LayoutContainer>
  175. </template>
  176. <script lang="ts">
  177. import Vue from 'vue'
  178. import StructuresProvider from '~/services/data/StructuresProvider'
  179. export default Vue.extend({
  180. async asyncData ({
  181. params, $axios
  182. }): Promise<{ structure: Structure }> {
  183. return await new StructuresProvider($axios).getById(Number(params.id)).then((res) => {
  184. return { structure: res }
  185. })
  186. },
  187. data (): object {
  188. return {
  189. showTel: false,
  190. showMail: false
  191. }
  192. }
  193. })
  194. </script>
  195. <style scoped lang="scss">
  196. @import 'assets/style/variables.scss';
  197. .content {
  198. margin: 18px 10%;
  199. max-width: 80%;
  200. }
  201. h2 {
  202. color: $theme;
  203. font-size: 22px;
  204. }
  205. h4 {
  206. color: #666;
  207. border-bottom: solid 1px $theme;
  208. font-size: 22px;
  209. }
  210. .social-icon {
  211. font-size: 22px;
  212. color: gray;
  213. margin: auto 8px;
  214. }
  215. .content {
  216. color: #666666;
  217. }
  218. @media screen and (min-width: 600px) {
  219. .description {
  220. border-right: solid 2px #e4611b;
  221. width: 45%;
  222. padding-right: 5%;
  223. }
  224. .contact {
  225. width: 45%;
  226. padding-left: 5%;
  227. }
  228. }
  229. .contact td {
  230. padding: 6px 12px;
  231. }
  232. .contact .icon {
  233. color: $theme;
  234. }
  235. </style>