Skip to content

Commit

Permalink
feat:c2corg#3936 display public transportation icon in waypoint title
Browse files Browse the repository at this point in the history
  • Loading branch information
Nayor committed May 6, 2024
1 parent d40a9aa commit 58c88cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/cards/WaypointCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

<textual-array :array="document.slackline_types" i18n i18n-context="slackline_types" />

<marker-soft-mobility v-if="$documentUtils.hasSoftMobility(document)" />

<marker-quality :quality="document.quality" />
</card-row>
</card-container>
Expand Down
8 changes: 8 additions & 0 deletions src/js/vue-plugins/document-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import c2c from '@/js/apis/c2c';
import constants from '@/js/constants';
import common from '@/js/constants/common.json';

// we need to use a VM, because we need access to Vue.$user.lang

Expand Down Expand Up @@ -375,6 +376,13 @@ export default function install(Vue) {
}
},

hasSoftMobility(document) {
return (
document.public_transportation_rating &&
common.attributes.public_transportation_ratings.indexOf(document.public_transportation_rating) > 1
);
},

getDocumentsBbox(documents) {
documents = documents.filter((document) => document.geometry?.geom);

Expand Down
1 change: 1 addition & 0 deletions src/views/document/utils/boxes/AssociatedDocuments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</div>
<div class="column is-paddingless">
<document-title :document="waypoint" />
<marker-soft-mobility v-if="$documentUtils.hasSoftMobility(waypoint)" class="icon-link" />
</div>
<div class="column is-narrow has-text-grey is-paddingless is-size-7">{{ waypoint.elevation }}&nbsp;m</div>
</document-link>
Expand Down

0 comments on commit 58c88cf

Please sign in to comment.