Fix display of routes info
This commit is contained in:
parent
5f905c578d
commit
03bd94636d
@ -15,27 +15,24 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
info(route) {
|
info(route) {
|
||||||
return this.height(route) + this.orientations(route) + this.rating(route)
|
return [this.height(route), this.orientations(route), this.rating(route)]
|
||||||
|
.filter(e => !!e)
|
||||||
|
.join(', ')
|
||||||
},
|
},
|
||||||
height(route) {
|
height(route) {
|
||||||
return route.height.heightDiffDifficulties ? route.height.heightDiffDifficulties + ' m, ' : '';
|
return route.height.heightDiffDifficulties ? route.height.heightDiffDifficulties + ' m' : '';
|
||||||
},
|
},
|
||||||
orientations(route) {
|
orientations(route) {
|
||||||
if (route.orientations) {
|
return route.orientations ? route.orientations.join(',') : '';
|
||||||
return route.orientations.join(',')
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
rating(route) {
|
rating(route) {
|
||||||
if (route.rating) {
|
let items = []
|
||||||
let str = route.rating.global + ' ' + route.rating.free
|
|
||||||
if (route.rating.required)
|
for (let value of Object.values(route.rating)) {
|
||||||
str += '>' + route.rating.required
|
if (value) items.push(value)
|
||||||
if (route.rating.engagement)
|
|
||||||
str += ' ' + route.rating.engagement
|
|
||||||
if (route.rating.equipmentQuality)
|
|
||||||
str += ' ' + route.rating.equipmentQuality
|
|
||||||
return str
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return items.join(' ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user