diff --git a/src/components/generics/pretty/PrettyRoute.vue b/src/components/generics/pretty/PrettyRoute.vue index 9d69ac6086..26a92e2da9 100644 --- a/src/components/generics/pretty/PrettyRoute.vue +++ b/src/components/generics/pretty/PrettyRoute.vue @@ -6,14 +6,17 @@ :activities="route.activities" class="is-size-4 has-text-secondary icon-activities" /> + + {{ heightUpText }} m + + + {{ heightDiffText }}, + - {{ route.height_diff_difficulties }} m, - - {{ route.orientations.join(', ') }}, @@ -58,6 +61,36 @@ export default { rangeAreas() { return this.route.areas.filter((area) => area.area_type === 'range'); }, + heightUpText() { + if ( + this.route.activities && + (this.route.activities.includes('skitouring') || + this.route.activities.includes('snowshoeing') || + this.route.activities.includes('hiking')) + ) { + if (this.route.height_diff_up) return '+' + this.route.height_diff_up; + if (this.route.height_diff_down) return '-' + this.route.height_diff_down; + } + return ''; + }, + heightDiffText() { + if (this.hideHeightDiffDifficulties) return ''; + const act = this.route.activities; + if (!act) return; + const is_alpinism = + act.includes('snow_ice_mixed') || + act.includes('mountain_climbing') || + act.includes('rock_climbing') || + act.includes('ice_climbing') || + act.includes('skitouring'); + // don't clutter with difficulties for "easy" activities + if (this.heightUpText && !is_alpinism) return ''; + const dd = this.route.height_diff_difficulties; + if (!dd || (this.heightUpText && dd === this.route.height_diff_up)) return ''; + // to differentiate the 2 heights, use parenthesis + const ddstr = dd + '\u200am'; + return this.heightUpText ? '(' + ddstr + ')' : ddstr; + }, }, };