| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- <template>
- <LayoutContainer>
- <header class="mb-4">
- <v-layout>
- <v-btn
- v-if="parent"
- :to="{path: '/structures', query: { parent: parent, view: view, theme: theme, hideTitle: hideTitle }}"
- nuxt
- plain
- >
- <font-awesome-icon class="icon mr-1" :icon="['fas', 'chevron-left']" />
- {{ $t('go_back') }}
- </v-btn>
- </v-layout>
- </header>
- <v-container class="content">
- <v-layout class="flex-row align-center mb-4">
- <v-img
- v-if="structure.logoId"
- :src="'https://api.opentalent.fr/app.php/_internal/secure/files/' + structure.logoId + '/0x60'"
- alt="logo"
- max-width="60"
- />
- <h2 class="flex mx-4 d-flex align-center">
- {{ structure.name }}
- </h2>
- <div class="d-flex flex-row align-center">
- <a v-if="structure.facebook" :href="structure.facebook" class="facebook" target="_blank" :title="$t('find_us_on') + ' Facebook'">
- <font-awesome-icon class="icon social-icon" :icon="['fab', 'facebook']" />
- </a>
- <a v-if="structure.instagram" :href="structure.instagram" class="instagram" target="_blank" :title="$t('find_us_on') + ' Instagram'">
- <font-awesome-icon class="icon social-icon" :icon="['fab', 'instagram-square']" />
- </a>
- <a v-if="structure.twitter" :href="structure.twitter" class="twitter" target="_blank" title="$t('find_us_on') + ' Twitter'">
- <font-awesome-icon class="icon social-icon" :icon="['fab', 'twitter']" />
- </a>
- <a v-if="structure.youtube" :href="structure.youtube" class="youtube" target="_blank" title="$t('find_us_on') + ' Youtube'">
- <font-awesome-icon class="icon social-icon" :icon="['fab', 'youtube']" />
- </a>
- </div>
- </v-layout>
- <v-row>
- <v-col class="d-flex justify-center" cols="12">
- <img
- v-if="structure.imageId"
- :src="'https://api.opentalent.fr/app.php/_internal/secure/files/' + structure.imageId + '/raw'"
- alt="banner"
- style="max-height: 300px;max-width: 100%"
- >
- </v-col>
- </v-row>
- <v-row>
- <v-col cols="12">
- <div
- v-if="structure.practices"
- class="d-flex justify-center flex-wrap"
- >
- <v-chip
- v-for="practice in structure.practices"
- :key="practice"
- class="ma-1"
- label
- >
- {{ $t(practice) }}
- </v-chip>
- </div>
- </v-col>
- </v-row>
- <v-row class="mb-4">
- <v-col cols="12" class="d-flex flex-row justify-center">
- <v-btn
- v-for="article in structure.articles"
- :key="article.id"
- :href="article.link ? ((article.link.match(/https?:\/\/.*/) ? '' : 'https://') + article.link) : ''"
- target="_blank"
- small
- color="primary"
- class="ma-2"
- :title="article.title"
- >
- <font-awesome-icon class="icon mr-1" :icon="['fas', 'star']" />
- {{ $t('spot_on_from') + ' ' + new Date(article.date).toLocaleDateString($i18n.locale) }}
- </v-btn>
- </v-col>
- </v-row>
- <v-divider class="my-2" />
- <v-row class="my-2 py-2">
- <v-col
- cols="12"
- sm="6"
- class="description"
- >
- <div class="d-flex flex-row mb-3">
- <h4>{{ $t('descriptive') }}</h4>
- <v-spacer />
- </div>
- <div class="pa-2">
- <p v-if="structure.description" class="text-justify">
- {{ structure.description }}
- </p>
- <i v-else>({{ $t('no_description') }})</i>
- </div>
- </v-col>
- <v-col
- cols="12"
- sm="6"
- class="contact"
- >
- <div class="d-flex flex-row mb-3">
- <h4>{{ $t('contact') }}</h4>
- <v-spacer />
- </div>
- <table>
- <tr
- v-if="structure.mapAddress && (structure.mapAddress.postalCode !== structure.postalAddress.postalCode || structure.mapAddress.streetAddress !== structure.postalAddress.streetAddress)"
- >
- <td style="vertical-align: top">
- <font-awesome-icon class="icon" :icon="['fas', 'map-marker-alt']" />
- </td>
- <td class="mx-2" style="vertical-align: top">
- <span v-if="structure.mapAddress.streetAddress" style="white-space: pre-line;">{{ structure.mapAddress.streetAddress }}<br></span>
- <span v-if="structure.mapAddress.postalCode">{{ structure.mapAddress.postalCode }} </span>
- {{ structure.mapAddress.addressCity }}
- </td>
- </tr>
- <tr v-if="structure.postalAddress">
- <td style="vertical-align: top">
- <font-awesome-icon class="icon" :icon="['fas', 'envelope']" />
- </td>
- <td class="mx-2" style="vertical-align: top">
- <div style="text-decoration: underline; font-size: 0.9em; margin-bottom: 0.25em;">
- {{ $t('to_mail_us') }} :
- </div>
- <span>{{ structure.name }}<br></span>
- <span v-if="structure.postalAddress.streetAddress" style="white-space: pre-line;">{{ structure.postalAddress.streetAddress }}<br></span>
- <span v-if="structure.postalAddress.postalCode">{{ structure.postalAddress.postalCode }} </span>
- {{ structure.postalAddress.addressCity }}
- </td>
- </tr>
- <tr>
- <td>
- <font-awesome-icon class="icon" :icon="['fas', 'phone-alt']" />
- </td>
- <td class="phone">
- <div v-if="structure.telphone || structure.mobilPhone">
- <a v-if="showTel" :href="'tel:' + (structure.telphone || structure.mobilPhone)" class="neutral">
- {{ formatPhoneNumber(structure.telphone || structure.mobilPhone) }}
- </a>
- <v-btn v-else small @click="showTel = 1">
- {{ $t('show_tel') }}
- </v-btn>
- </div>
- <span v-else>-</span>
- </td>
- </tr>
- <tr>
- <td>
- <font-awesome-icon class="icon" :icon="['fas', 'at']" />
- </td>
- <td class="mail">
- <div v-if="structure.email">
- <a v-if="showMail" :href="'mailto:' + structure.email" class="neutral">
- {{ structure.email }}
- </a>
- <v-btn v-else small @click="showMail = 1">
- {{ $t('show_email') }}
- </v-btn>
- </div>
- <span v-else>-</span>
- </td>
- </tr>
- <tr>
- <td>
- <font-awesome-icon class="icon" :icon="['fas', 'globe-europe']" />
- </td>
- <td class="website">
- <a class="neutral" :href="structure.website" target="_blank">{{ structure.website }}</a>
- </td>
- </tr>
- <tr>
- <td>
- <font-awesome-icon class="icon" :icon="['fas', 'project-diagram']" />
- </td>
- <td class="network">
- <NuxtLink
- v-if="parent && (structure.n1Id !== parent)"
- class="neutral"
- :to="{path: '/structures/' + structure.n1Id, query: { parent: parent, view: view, theme: theme }}"
- nuxt
- >
- {{ structure.n1Name }}
- </NuxtLink>
- <div v-else>
- {{ structure.n1Name }}
- </div>
- </td>
- </tr>
- </table>
- </v-col>
- </v-row>
- <v-row v-if="structure.latitude && structure.longitude">
- <v-col cols="12">
- <v-responsive width="100%" height="450px">
- <no-ssr>
- <l-map
- id="map"
- :zoom="13"
- :center="[structure.latitude, structure.longitude]"
- :options="{ scrollWheelZoom: false, zoomSnap: 0.25 }"
- >
- <l-tile-layer
- url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"
- attribution="© <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"
- />
- <l-marker
- :key="structure.id"
- :lat-lng="[structure.latitude, structure.longitude]"
- >
- <l-popup>
- <b>{{ structure.name }}</b><br>
- <span v-if="structure.mapAddress">
- {{ structure.mapAddress.postalCode }} {{ structure.mapAddress.addressCity }}
- </span><br>
- <a :href="structure.website" target="_blank">{{ structure.website }}</a>
- </l-popup>
- </l-marker>
- </l-map>
- </no-ssr>
- </v-responsive>
- </v-col>
- </v-row>
- </v-container>
- </LayoutContainer>
- </template>
- <script lang="ts">
- import Vue from 'vue'
- // eslint-disable-next-line import/no-named-as-default
- import parsePhoneNumber from 'libphonenumber-js'
- import StructuresProvider from '~/services/data/StructuresProvider'
- export default Vue.extend({
- async asyncData ({
- params, $axios
- }): Promise<{ structure: Structure }> {
- return await new StructuresProvider($axios).getById(Number(params.id)).then((res) => {
- return { structure: res }
- })
- },
- data (): object {
- return {
- parent: this.$route.query.parent ? parseInt(this.$route.query.parent as string) : null,
- view: this.$route.query.view ?? 'map',
- theme: this.$route.query.theme ?? 'orange',
- hideTitle: this.$route.query.hideTitle ?? false,
- showTel: false,
- showMail: false
- }
- },
- methods: {
- formatPhoneNumber (number: string): string {
- const parsed = parsePhoneNumber(number)
- return parsed ? parsed.formatNational() : ''
- }
- }
- })
- </script>
- <style scoped lang="scss">
- @import 'assets/style/variables.scss';
- .content {
- margin: 18px 10%;
- max-width: 80%;
- }
- h2 {
- color: var(--v-primary-base);
- font-size: 22px;
- }
- h4 {
- color: #666;
- border-bottom: solid 1px var(--v-primary-base);
- font-size: 22px;
- }
- .social-icon {
- font-size: 22px;
- color: #808080;
- margin: auto 8px;
- }
- .social-icon:hover {
- color: #595959;
- }
- .content {
- color: #4d4d4d;
- }
- @media screen and (min-width: 600px) {
- .description {
- border-right: solid 2px var(--v-primary-base);
- width: 45%;
- padding-right: 5%;
- }
- .contact {
- width: 45%;
- padding-left: 5%;
- }
- }
- .contact td {
- padding: 6px 12px;
- }
- .contact .icon {
- color: var(--v-primary-base);
- }
- </style>
|