_id.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. {{ structure.address }}
  78. </td>
  79. </tr>
  80. <tr>
  81. <td>
  82. <font-awesome-icon class="icon" :icon="['fas', 'phone-alt']" />
  83. </td>
  84. <td class="phone">
  85. <a :href="'tel:' + structure.telphone">{{ structure.telphone }}</a>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td>
  90. <font-awesome-icon class="icon" :icon="['fas', 'envelope']" />
  91. </td>
  92. <td class="mail">
  93. <a :href="'mailto:' + structure.mail">{{ structure.mail }}</a>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td>
  98. <font-awesome-icon class="icon" :icon="['fas', 'globe-europe']" />
  99. </td>
  100. <td class="website">
  101. <a :href="structure.website">{{ structure.website }}</a>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td>
  106. <font-awesome-icon class="icon" :icon="['fas', 'project-diagram']" />
  107. </td>
  108. <td class="network">
  109. {{ structure.n1Name }}
  110. </td>
  111. </tr>
  112. </table>
  113. </v-col>
  114. </v-row>
  115. <v-row class="mb-4">
  116. <v-col cols="12">
  117. <v-btn disabled>
  118. {{ $t('spot_on_from') }} 01/01/2021
  119. </v-btn>
  120. </v-col>
  121. </v-row>
  122. <v-row v-if="structure.latitude && structure.longitude">
  123. <v-col cols="12">
  124. <v-responsive width="100%" height="450px">
  125. <no-ssr>
  126. <l-map
  127. :zoom="13"
  128. :center="[structure.latitude, structure.longitude]"
  129. :options="{ scrollWheelZoom: false, zoomSnap: 0.25 }"
  130. >
  131. <l-tile-layer
  132. url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"
  133. attribution="&copy; <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"
  134. />
  135. <l-marker
  136. :key="structure.id"
  137. :lat-lng="[structure.latitude, structure.longitude]"
  138. >
  139. <l-popup>
  140. <b>{{ structure.name }}</b><br>
  141. {{ structure.postalCode }} {{ structure.addressCity }}<br>
  142. <a :href="structure.website" target="_blank">{{ structure.website }}</a>
  143. </l-popup>
  144. </l-marker>
  145. </l-map>
  146. </no-ssr>
  147. </v-responsive>
  148. </v-col>
  149. </v-row>
  150. </v-container>
  151. </LayoutContainer>
  152. </template>
  153. <script>
  154. export default {
  155. async asyncData ({ $config, params }) {
  156. return await fetch(
  157. `${$config.baseURL}/api/public/federation_structures/get?organization-id=${params.id}`
  158. ).then(
  159. res => res.json()
  160. ).then(
  161. (s) => {
  162. s.n1Id = s.n1Id ? parseInt(s.n1Id) : null
  163. s.n2Id = s.n2Id ? parseInt(s.n2Id) : null
  164. s.n3Id = s.n3Id ? parseInt(s.n3Id) : null
  165. s.n4Id = s.n4Id ? parseInt(s.n4Id) : null
  166. s.n5Id = s.n5Id ? parseInt(s.n5Id) : null
  167. s.practices = s.practices !== null ? s.practices.split(',') : []
  168. s.latitude = s.latitude ? parseFloat(s.latitude) : null
  169. s.longitude = s.longitude ? parseFloat(s.longitude) : null
  170. s.address = [s.streetAddress, s.postalCode, s.addressCity].join(' ')
  171. s.facebook = 'https://facebook.com'
  172. s.twitter = 'https://twitter.com'
  173. s.instagram = 'https://instagram.com'
  174. return { structure: s }
  175. }
  176. )
  177. }
  178. }
  179. </script>
  180. <style scoped lang="scss">
  181. @import 'assets/style/variables.scss';
  182. .content {
  183. margin: 18px 10%;
  184. max-width: 80%;
  185. }
  186. h2 {
  187. color: $theme;
  188. font-size: 22px;
  189. }
  190. h4 {
  191. color: #666;
  192. border-bottom: solid 1px $theme;
  193. font-size: 22px;
  194. }
  195. .social-icon {
  196. font-size: 24px;
  197. color: gray;
  198. margin: auto 4px;
  199. }
  200. .description {
  201. border-right: solid 2px #e4611b;
  202. width: 45%;
  203. padding-right: 5%;
  204. }
  205. .contact {
  206. width: 45%;
  207. padding-left: 5%;
  208. }
  209. .contact td {
  210. padding: 6px 12px;
  211. }
  212. .contact .icon {
  213. color: $theme;
  214. }
  215. </style>