kopia lustrzana https://github.com/manuelkasper/sotlas-frontend
Use user ID instead of callsign to link to activator whenever possible.
This sends the user to the right activator page even in case of changed callsigns, club calls etc.pull/10/head v1.10.1
rodzic
3fbddecd37
commit
90694deae9
|
@ -6,7 +6,7 @@
|
|||
{{ props.row.activationDate | formatActivationDate }}
|
||||
</b-table-column>
|
||||
<b-table-column field="ownCallsign" label="Activator" sortable>
|
||||
<router-link :to="makeActivatorLink(props.row.ownCallsign.toUpperCase())">{{ props.row.ownCallsign.toUpperCase() }}</router-link>
|
||||
<router-link :to="makeActivatorLinkUserId(props.row.userId)">{{ props.row.ownCallsign.toUpperCase() }}</router-link>
|
||||
</b-table-column>
|
||||
<b-table-column field="qsos" label="QSOs" sortable numeric>
|
||||
<span class="qsos" @click="openQsoList(props.row.id)">{{ props.row.qsos }}</span>
|
||||
|
|
|
@ -153,6 +153,9 @@ export default {
|
|||
})
|
||||
return '/activators/' + longestPart
|
||||
},
|
||||
makeActivatorLinkUserId (userId) {
|
||||
return '/activators/' + userId
|
||||
},
|
||||
makeSummitLink (summitCode) {
|
||||
return '/summits/' + summitCode
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<PageLayout>
|
||||
<template v-slot:title>Activation</template>
|
||||
<template v-if="activationDetails" v-slot:subtitle><router-link :to="makeActivatorLink(activationDetails.OwnCallsign)">{{ activationDetails.OwnCallsign }}</router-link> on <router-link :to="makeSummitLink(summitCode)">{{ activationDetails.Summit }}</router-link>, <span class="activation-date">{{ niceActivationDate }}</span></template>
|
||||
<template v-if="activationDetails" v-slot:subtitle><router-link :to="makeActivatorLinkUserId(activationDetails.UserID)">{{ activationDetails.OwnCallsign }}</router-link> on <router-link :to="makeSummitLink(summitCode)">{{ activationDetails.Summit }}</router-link>, <span class="activation-date">{{ niceActivationDate }}</span></template>
|
||||
|
||||
<template>
|
||||
<section class="section">
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<div>Locator: <span class="locator">{{ locator }}</span></div>
|
||||
<div v-if="$keycloak && $keycloak.authenticated && summit.coordinates">Distance/Bearing: <Bearing :latitude="summit.coordinates.latitude" :longitude="summit.coordinates.longitude" /></div>
|
||||
<div v-if="firstActivations">First activation:
|
||||
<span v-for="(callsign, index) in firstActivations.callsigns" :key="callsign"><router-link :to="makeActivatorLink(callsign)"><strong>{{ callsign }}</strong></router-link>{{ index !== firstActivations.callsigns.length - 1 ? ' & ' : '' }}</span>
|
||||
<span v-for="(activator, index) in firstActivations.activators" :key="activator.userId"><router-link :to="makeActivatorLinkUserId(activator.userId)"><strong>{{ activator.callsign }}</strong></router-link>{{ index !== firstActivations.activators.length - 1 ? ' & ' : '' }}</span>
|
||||
<span class="has-text-grey"> on {{ firstActivations.date | formatActivationDate }}</span></div>
|
||||
|
||||
<SummitAttributes :attributes="summit.attributes" />
|
||||
|
@ -173,10 +173,13 @@ export default {
|
|||
let firstActivationDate = this.activations[this.activations.length - 1].activationDate
|
||||
let firstActivationCallsigns = []
|
||||
for (let i = this.activations.length - 1; i >= 0 && this.activations[i].activationDate === firstActivationDate; i--) {
|
||||
firstActivationCallsigns.push(this.activations[i].ownCallsign)
|
||||
firstActivationCallsigns.push({
|
||||
callsign: this.activations[i].ownCallsign,
|
||||
userId: this.activations[i].userId
|
||||
})
|
||||
}
|
||||
firstActivationCallsigns.sort()
|
||||
return { callsigns: firstActivationCallsigns, date: firstActivationDate }
|
||||
firstActivationCallsigns.sort((a, b) => (a.callsign > b.callsign) ? 1 : -1)
|
||||
return { activators: firstActivationCallsigns, date: firstActivationDate }
|
||||
},
|
||||
region () {
|
||||
let regionCode = this.summitCode.substring(this.summitCode.indexOf('/') + 1, this.summitCode.indexOf('-'))
|
||||
|
|
Ładowanie…
Reference in New Issue