kopia lustrzana https://github.com/manuelkasper/sotlas-frontend
Handle no bonus correctly
rodzic
64a6a57f03
commit
5309668c5e
|
@ -1,10 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<b-tooltip class="season-tooltip" type="is-light" :position="$mq.mobile ? 'is-bottom' : 'is-right'" :label="seasonLabel">
|
<b-taglist v-if="points !== null && points !== undefined" :class="{ ['points-' + points]: true }" attached>
|
||||||
<b-taglist v-if="points !== null && points !== undefined" :class="{ ['points-' + points]: true }" attached>
|
<b-tag>{{ points }}</b-tag>
|
||||||
<b-tag>{{ points }}</b-tag>
|
<b-tag class="bonus" v-if="bonus">+{{ bonus }}</b-tag>
|
||||||
<b-tag class="bonus" v-if="bonus">+{{ bonus }}</b-tag>
|
</b-taglist>
|
||||||
</b-taglist>
|
|
||||||
</b-tooltip>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -16,18 +14,6 @@ export default {
|
||||||
},
|
},
|
||||||
bonus: {
|
bonus: {
|
||||||
type: Number
|
type: Number
|
||||||
},
|
|
||||||
season: {
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
seasonLabel: function () {
|
|
||||||
if (this.season) {
|
|
||||||
return '+ ' + this.season
|
|
||||||
} else {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,9 +32,6 @@ export default {
|
||||||
height: auto;
|
height: auto;
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
.season-tooltip {
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.tag {
|
.tag {
|
||||||
padding: 0.3em 0.4em;
|
padding: 0.3em 0.4em;
|
||||||
|
|
|
@ -20,7 +20,14 @@
|
||||||
<p class="subtitle is-size-7-mobile">
|
<p class="subtitle is-size-7-mobile">
|
||||||
<span class="summit-info"><strong>{{ summit.code }}</strong></span>
|
<span class="summit-info"><strong>{{ summit.code }}</strong></span>
|
||||||
<span class="summit-info"><AltitudeLabel :altitude="summit.altitude" /></span>
|
<span class="summit-info"><AltitudeLabel :altitude="summit.altitude" /></span>
|
||||||
<span class="summit-info"><SummitPointsLabel class="points" :points="summit.points" :bonus="summit.bonusPoints" :season="bonusSeason" /> {{ summit.points > 1 ? 'points' : 'point' }}</span>
|
<span v-if="bonusSeason" class="summit-info">
|
||||||
|
<b-tooltip class="season-tooltip" type="is-light" :position="$mq.mobile ? 'is-bottom' : 'is-right'" :label="bonusSeason">
|
||||||
|
<SummitPointsLabel class="points" :points="summit.points" :bonus="summit.bonusPoints" />
|
||||||
|
</b-tooltip> {{ summit.points > 1 ? 'points' : 'point' }}
|
||||||
|
</span>
|
||||||
|
<span v-else class="summit-info">
|
||||||
|
<SummitPointsLabel class="points" :points="summit.points" :bonus="summit.bonusPoints" /> {{ summit.points > 1 ? 'points' : 'point' }}
|
||||||
|
</span>
|
||||||
<span v-if="activations !== null" class="summit-info"><font-awesome-icon :icon="['far', 'chevron-circle-up']" class="faicon" /> {{ activations.length }} {{ activations.length === 1 ? 'activation' : 'activations' }}<span v-if="myActivations && myActivations.length > 0"> ({{ myActivations.length }} by me)</span></span>
|
<span v-if="activations !== null" class="summit-info"><font-awesome-icon :icon="['far', 'chevron-circle-up']" class="faicon" /> {{ activations.length }} {{ activations.length === 1 ? 'activation' : 'activations' }}<span v-if="myActivations && myActivations.length > 0"> ({{ myActivations.length }} by me)</span></span>
|
||||||
<span v-if="myChases !== null && myChases.length > 0" class="summit-info"><font-awesome-icon :icon="['far', 'chevron-circle-down']" class="faicon" /> {{ myChases.length }} {{ myChases.length === 1 ? 'chase' : 'chases' }} by me</span>
|
<span v-if="myChases !== null && myChases.length > 0" class="summit-info"><font-awesome-icon :icon="['far', 'chevron-circle-down']" class="faicon" /> {{ myChases.length }} {{ myChases.length === 1 ? 'chase' : 'chases' }} by me</span>
|
||||||
<span v-if="isComplete" class="summit-info"><font-awesome-icon :icon="['far', 'check-double']" class="faicon" /> Complete</span>
|
<span v-if="isComplete" class="summit-info"><font-awesome-icon :icon="['far', 'check-double']" class="faicon" /> Complete</span>
|
||||||
|
@ -386,7 +393,11 @@ export default {
|
||||||
|
|
||||||
loads.push(axios.get('https://api-db2.sota.org.uk/summits/history/' + this.summitCode)
|
loads.push(axios.get('https://api-db2.sota.org.uk/summits/history/' + this.summitCode)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.bonusSeason = response.data.BonusSeason
|
if (response.data.BonusPoints > 0) {
|
||||||
|
this.bonusSeason = '+ ' + response.data.BonusSeason
|
||||||
|
} else {
|
||||||
|
this.bonusSeason = null
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
if (this.myUserId) {
|
if (this.myUserId) {
|
||||||
|
@ -603,4 +614,7 @@ export default {
|
||||||
color: #b5b5b5;
|
color: #b5b5b5;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
.season-tooltip {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Ładowanie…
Reference in New Issue