|
@@ -5,9 +5,10 @@
|
|
|
<!-- Header -->
|
|
<!-- Header -->
|
|
|
<v-row>
|
|
<v-row>
|
|
|
<v-layout>
|
|
<v-layout>
|
|
|
- <h2 class="flex">
|
|
|
|
|
|
|
+ <h2 v-if="!hideTitle">
|
|
|
{{ $t("member_companies") }}
|
|
{{ $t("member_companies") }}
|
|
|
</h2>
|
|
</h2>
|
|
|
|
|
+ <div class="flex" />
|
|
|
<v-btn-toggle mandatory dense :value="mapview ? 0 : 1" @change="viewChanged">
|
|
<v-btn-toggle mandatory dense :value="mapview ? 0 : 1" @change="viewChanged">
|
|
|
<v-btn>
|
|
<v-btn>
|
|
|
{{ $t("map") }}
|
|
{{ $t("map") }}
|
|
@@ -197,7 +198,7 @@
|
|
|
outlined
|
|
outlined
|
|
|
:class="'structure-card pa-3 d-flex ' + ((mapview || $vuetify.breakpoint.smAndDown) ? 'flex-column' : 'flex-row align-items-center')"
|
|
:class="'structure-card pa-3 d-flex ' + ((mapview || $vuetify.breakpoint.smAndDown) ? 'flex-column' : 'flex-row align-items-center')"
|
|
|
>
|
|
>
|
|
|
- <div class="d-flex justify-center max-w100" >
|
|
|
|
|
|
|
+ <div class="d-flex justify-center max-w100">
|
|
|
<v-img
|
|
<v-img
|
|
|
v-if="structure.logoId"
|
|
v-if="structure.logoId"
|
|
|
:src="'https://api.opentalent.fr/app.php/_internal/secure/files/' + structure.logoId"
|
|
:src="'https://api.opentalent.fr/app.php/_internal/secure/files/' + structure.logoId"
|
|
@@ -208,11 +209,10 @@
|
|
|
:contain="true"
|
|
:contain="true"
|
|
|
style="margin: 12px;"
|
|
style="margin: 12px;"
|
|
|
/>
|
|
/>
|
|
|
- <div v-else style="height: 104px; width: 264px"></div>
|
|
|
|
|
|
|
+ <div v-else style="height: 104px; width: 264px" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div :class="'d-flex flex-column' + (listview ? ' flex-grow-1' : '')">
|
|
<div :class="'d-flex flex-column' + (listview ? ' flex-grow-1' : '')">
|
|
|
-
|
|
|
|
|
<v-card-title class="title">
|
|
<v-card-title class="title">
|
|
|
<nuxt-link :to="{path: '/structures/' + structure.id, query: { parent: parent, view: view, theme: theme }}">
|
|
<nuxt-link :to="{path: '/structures/' + structure.id, query: { parent: parent, view: view, theme: theme }}">
|
|
|
{{ structure.name }}
|
|
{{ structure.name }}
|
|
@@ -221,14 +221,14 @@
|
|
|
|
|
|
|
|
<v-card-text class="infos">
|
|
<v-card-text class="infos">
|
|
|
<table>
|
|
<table>
|
|
|
- <tr>
|
|
|
|
|
|
|
+ <tr v-if="structure.mapAddress">
|
|
|
<td>
|
|
<td>
|
|
|
<font-awesome-icon class="icon" :icon="['fas', 'map-marker-alt']" />
|
|
<font-awesome-icon class="icon" :icon="['fas', 'map-marker-alt']" />
|
|
|
</td>
|
|
</td>
|
|
|
<td>
|
|
<td>
|
|
|
- <span v-if="structure.streetAddress">{{ structure.streetAddress }}<br></span>
|
|
|
|
|
- <span v-if="structure.postalCode" class="postalCode">{{ structure.postalCode }} </span>
|
|
|
|
|
- {{ structure.addressCity }}
|
|
|
|
|
|
|
+ <span v-if="structure.mapAddress.streetAddress" style="white-space: pre-line;">{{ structure.mapAddress.streetAddress }}<br></span>
|
|
|
|
|
+ <span v-if="structure.mapAddress.postalCode" class="postalCode">{{ structure.mapAddress.postalCode }} </span>
|
|
|
|
|
+ {{ structure.mapAddress.addressCity }}
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
@@ -274,7 +274,7 @@
|
|
|
<v-card-actions :class="listview ? 'align-self-end' : 'justify-end'">
|
|
<v-card-actions :class="listview ? 'align-self-end' : 'justify-end'">
|
|
|
<v-btn
|
|
<v-btn
|
|
|
class="see"
|
|
class="see"
|
|
|
- :to="{path: '/structures/' + structure.id, query: { parent: parent, view: view, theme: theme }}"
|
|
|
|
|
|
|
+ :to="{path: '/structures/' + structure.id, query: { parent: parent, view: view, theme: theme, hideTitle: hideTitle }}"
|
|
|
nuxt
|
|
nuxt
|
|
|
>
|
|
>
|
|
|
<span style="margin-right: 6px;">{{ $t("see_more") }}</span>
|
|
<span style="margin-right: 6px;">{{ $t("see_more") }}</span>
|
|
@@ -298,6 +298,17 @@
|
|
|
</div>
|
|
</div>
|
|
|
</v-col>
|
|
</v-col>
|
|
|
</v-row>
|
|
</v-row>
|
|
|
|
|
+ <div class="d-flex w100 justify-center">
|
|
|
|
|
+ <v-btn
|
|
|
|
|
+ v-if="!parentIsCmf"
|
|
|
|
|
+ :href="cmfStructuresPageUrl"
|
|
|
|
|
+ target="_blank"
|
|
|
|
|
+ class="my-auto ma-4"
|
|
|
|
|
+ >
|
|
|
|
|
+ <font-awesome-icon :icon="['fas', 'external-link-alt']" class="mr-2" />
|
|
|
|
|
+ {{ $t('see_national_network') }}
|
|
|
|
|
+ </v-btn>
|
|
|
|
|
+ </div>
|
|
|
</LayoutContainer>
|
|
</LayoutContainer>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -310,6 +321,7 @@ import sphericDistance from '@/services/utils/geo'
|
|
|
import StructuresProvider from '~/services/data/StructuresProvider'
|
|
import StructuresProvider from '~/services/data/StructuresProvider'
|
|
|
|
|
|
|
|
const CMF_ID = 12097
|
|
const CMF_ID = 12097
|
|
|
|
|
+const CMF_STRUCTURES_PAGE_URL = 'https://www.cmf-musique.org/la-cmf/la-cmf-en-region/cmf-en-region/'
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
export default Vue.extend({
|
|
|
validate ({ query }) {
|
|
validate ({ query }) {
|
|
@@ -330,6 +342,7 @@ export default Vue.extend({
|
|
|
parent: parseInt(this.$route.query.parent as string),
|
|
parent: parseInt(this.$route.query.parent as string),
|
|
|
view: this.$route.query.view ?? 'map',
|
|
view: this.$route.query.view ?? 'map',
|
|
|
theme: this.$route.query.theme ?? 'orange',
|
|
theme: this.$route.query.theme ?? 'orange',
|
|
|
|
|
+ hideTitle: this.$route.query.hideTitle === 'true',
|
|
|
structures: [] as Array<Structure>,
|
|
structures: [] as Array<Structure>,
|
|
|
filteredStructures: [] as Array<Structure>,
|
|
filteredStructures: [] as Array<Structure>,
|
|
|
federations: [] as Array<{ id: number | null, name: string | null }>,
|
|
federations: [] as Array<{ id: number | null, name: string | null }>,
|
|
@@ -371,6 +384,9 @@ export default Vue.extend({
|
|
|
parentIsCmf (): Boolean {
|
|
parentIsCmf (): Boolean {
|
|
|
return this.parent === CMF_ID
|
|
return this.parent === CMF_ID
|
|
|
},
|
|
},
|
|
|
|
|
+ cmfStructuresPageUrl (): string {
|
|
|
|
|
+ return CMF_STRUCTURES_PAGE_URL
|
|
|
|
|
+ },
|
|
|
onMapFilteredStructures (): Array<Structure> {
|
|
onMapFilteredStructures (): Array<Structure> {
|
|
|
if (this.mapview && this.mapBoundsFilterStarted) {
|
|
if (this.mapview && this.mapBoundsFilterStarted) {
|
|
|
return this.filteredStructures.filter((s) => {
|
|
return this.filteredStructures.filter((s) => {
|
|
@@ -469,12 +485,15 @@ export default Vue.extend({
|
|
|
*/
|
|
*/
|
|
|
matchLocationFilter (structure: Structure): boolean {
|
|
matchLocationFilter (structure: Structure): boolean {
|
|
|
if (!this.locationFilter) { return true }
|
|
if (!this.locationFilter) { return true }
|
|
|
- if (!structure.latitude || !structure.longitude) { return false }
|
|
|
|
|
|
|
+ if (structure.mapAddress === null || !structure.mapAddress.latitude || !structure.mapAddress.longitude) { return false }
|
|
|
|
|
|
|
|
const radius = Number(this.distanceFilter) ?? 5
|
|
const radius = Number(this.distanceFilter) ?? 5
|
|
|
|
|
|
|
|
return sphericDistance(
|
|
return sphericDistance(
|
|
|
- this.locationFilter.latitude, this.locationFilter.longitude, structure.latitude, structure.longitude
|
|
|
|
|
|
|
+ this.locationFilter.latitude,
|
|
|
|
|
+ this.locationFilter.longitude,
|
|
|
|
|
+ structure.mapAddress.latitude,
|
|
|
|
|
+ structure.mapAddress.longitude
|
|
|
) <= radius
|
|
) <= radius
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -493,10 +512,12 @@ export default Vue.extend({
|
|
|
*/
|
|
*/
|
|
|
matchDepartmentFilter (structure: Structure): boolean {
|
|
matchDepartmentFilter (structure: Structure): boolean {
|
|
|
if (!this.departmentFilter) { return true }
|
|
if (!this.departmentFilter) { return true }
|
|
|
- return structure.postalCode !== null &&
|
|
|
|
|
|
|
+ return structure.mapAddress !== null &&
|
|
|
|
|
+ typeof structure.mapAddress.postalCode !== 'undefined' &&
|
|
|
|
|
+ structure.mapAddress.postalCode !== null &&
|
|
|
(
|
|
(
|
|
|
- structure.postalCode.startsWith(this.departmentFilter) ||
|
|
|
|
|
- (['2A', '2B'].includes(this.departmentFilter) && structure.postalCode.startsWith('20'))
|
|
|
|
|
|
|
+ structure.mapAddress.postalCode.startsWith(this.departmentFilter) ||
|
|
|
|
|
+ (['2A', '2B'].includes(this.departmentFilter) && structure.mapAddress.postalCode.startsWith('20'))
|
|
|
)
|
|
)
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -515,11 +536,11 @@ export default Vue.extend({
|
|
|
*/
|
|
*/
|
|
|
matchMapBounds (structure: Structure): boolean {
|
|
matchMapBounds (structure: Structure): boolean {
|
|
|
if (!this.mapBoundsFilter) { return true }
|
|
if (!this.mapBoundsFilter) { return true }
|
|
|
- if (!(structure.latitude && structure.longitude)) { return false }
|
|
|
|
|
- return this.mapBoundsFilter.getSouth() <= structure.latitude &&
|
|
|
|
|
- structure.latitude <= this.mapBoundsFilter.getNorth() &&
|
|
|
|
|
- this.mapBoundsFilter.getWest() <= structure.longitude &&
|
|
|
|
|
- structure.longitude <= this.mapBoundsFilter.getEast()
|
|
|
|
|
|
|
+ if (structure.mapAddress === null || !(structure.mapAddress.latitude && structure.mapAddress.longitude)) { return false }
|
|
|
|
|
+ return this.mapBoundsFilter.getSouth() <= structure.mapAddress.latitude &&
|
|
|
|
|
+ structure.mapAddress.latitude <= this.mapBoundsFilter.getNorth() &&
|
|
|
|
|
+ this.mapBoundsFilter.getWest() <= structure.mapAddress.longitude &&
|
|
|
|
|
+ structure.mapAddress.longitude <= this.mapBoundsFilter.getEast()
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* Does the structure match each of the page filters
|
|
* Does the structure match each of the page filters
|