_id.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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 cols="6" class="description">
  54. <div class="d-flex flex-row mb-3">
  55. <h4>{{ $t('descriptive') }}</h4>
  56. <v-spacer />
  57. </div>
  58. <p class="pa-2">
  59. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
  60. dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
  61. ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
  62. eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
  63. deserunt mollit anim id est laborum.
  64. </p>
  65. </v-col>
  66. <v-col cols="6" class="contact">
  67. <div class="d-flex flex-row mb-3">
  68. <h4>{{ $t('contact') }}</h4>
  69. <v-spacer />
  70. </div>
  71. <table>
  72. <tr>
  73. <td>
  74. <font-awesome-icon class="icon" :icon="['fas', 'map-marker-alt']" />
  75. </td>
  76. <td class="mx-2">
  77. <span v-if="structure.streetAddress">{{ structure.streetAddress }}<br></span>
  78. <span v-if="structure.postalCode">{{ structure.postalCode }} </span>
  79. {{ structure.addressCity }}
  80. </td>
  81. </tr>
  82. <tr>
  83. <td>
  84. <font-awesome-icon class="icon" :icon="['fas', 'phone-alt']" />
  85. </td>
  86. <td class="phone">
  87. <div v-if="structure.telphone">
  88. <a v-if="showTel" :href="'tel:' + structure.telphone">{{ structure.telphone }}</a>
  89. <v-btn v-else small @click="showTel = 1">
  90. {{ $t('show_tel') }}
  91. </v-btn>
  92. </div>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td>
  97. <font-awesome-icon class="icon" :icon="['fas', 'at']" />
  98. </td>
  99. <td class="mail">
  100. <div v-if="structure.email">
  101. <a v-if="showMail" :href="'mailto:' + structure.email">{{ structure.email }}</a>
  102. <v-btn v-else small @click="showMail = 1">
  103. {{ $t('show_email') }}
  104. </v-btn>
  105. </div>
  106. </td>
  107. </tr>
  108. <tr>
  109. <td>
  110. <font-awesome-icon class="icon" :icon="['fas', 'globe-europe']" />
  111. </td>
  112. <td class="website">
  113. <a :href="structure.website" target="_blank">{{ structure.website }}</a>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td>
  118. <font-awesome-icon class="icon" :icon="['fas', 'project-diagram']" />
  119. </td>
  120. <td class="network">
  121. <NuxtLink :to="'/structures/' + structure.n1Id" nuxt>
  122. {{ structure.n1Name }}
  123. </NuxtLink>
  124. </td>
  125. </tr>
  126. </table>
  127. </v-col>
  128. </v-row>
  129. <v-row class="mb-4">
  130. <v-col cols="12">
  131. <v-btn disabled>
  132. {{ $t('spot_on_from') }} 01/01/2021
  133. </v-btn>
  134. </v-col>
  135. </v-row>
  136. <v-row v-if="structure.latitude && structure.longitude">
  137. <v-col cols="12">
  138. <v-responsive width="100%" height="450px">
  139. <no-ssr>
  140. <l-map
  141. :zoom="13"
  142. :center="[structure.latitude, structure.longitude]"
  143. :options="{ scrollWheelZoom: false, zoomSnap: 0.25 }"
  144. >
  145. <l-tile-layer
  146. url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"
  147. attribution="&copy; <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"
  148. />
  149. <l-marker
  150. :key="structure.id"
  151. :lat-lng="[structure.latitude, structure.longitude]"
  152. >
  153. <l-popup>
  154. <b>{{ structure.name }}</b><br>
  155. {{ structure.postalCode }} {{ structure.addressCity }}<br>
  156. <a :href="structure.website" target="_blank">{{ structure.website }}</a>
  157. </l-popup>
  158. </l-marker>
  159. </l-map>
  160. </no-ssr>
  161. </v-responsive>
  162. </v-col>
  163. </v-row>
  164. </v-container>
  165. </LayoutContainer>
  166. </template>
  167. <script>
  168. import StructuresProvider from '~/services/data/StructuresProvider'
  169. export default {
  170. async asyncData ({ params, $axios }) {
  171. return await new StructuresProvider($axios).getById(Number(params.id)).then((res) => {
  172. return { structure: res }
  173. })
  174. },
  175. data () {
  176. return {
  177. showTel: false,
  178. showMail: false
  179. }
  180. }
  181. }
  182. </script>
  183. <style scoped lang="scss">
  184. @import 'assets/style/variables.scss';
  185. .content {
  186. margin: 18px 10%;
  187. max-width: 80%;
  188. }
  189. h2 {
  190. color: $theme;
  191. font-size: 22px;
  192. }
  193. h4 {
  194. color: #666;
  195. border-bottom: solid 1px $theme;
  196. font-size: 22px;
  197. }
  198. .social-icon {
  199. font-size: 22px;
  200. color: gray;
  201. margin: auto 8px;
  202. }
  203. .content {
  204. color: #666666;
  205. }
  206. .description {
  207. border-right: solid 2px #e4611b;
  208. width: 45%;
  209. padding-right: 5%;
  210. }
  211. .contact {
  212. width: 45%;
  213. padding-left: 5%;
  214. }
  215. .contact td {
  216. padding: 6px 12px;
  217. }
  218. .contact .icon {
  219. color: $theme;
  220. }
  221. </style>