Files
habitica/website/client/components/achievements/questCompleted.vue
T
negue 4108a22d78 [WIP] bootstrap-vue upgrade (#9178)
* update bootstrap-vue to 1.0.0-beta.9 - remove all individual bootstrap components and use BootstrapVue into Vue

* change modal action names from show::modal to bv::show::modal

* check if drops are undefined

* fix modal widths - sellModal now using input instead of dropbox

* upgrade to bootstrap 4.0beta

* include package-lock changes

* fix app menu dropdown position

* upgrade bootstrap to beta2 (was missing grid offset and other fixes) - refix header menu position

* fix tags popup (auto width to max not working) - fix filter panel width (adding width: 100% works until max-width)

* show hide logo on different screensize (new css breakpoints - http://getbootstrap.com/docs/4.0/utilities/display/ )

* fix package-lock?

* fix active button style / app header toggle button

* fix package-lock !

* update package lock after merge - new mixin "openedItemRows" to save the "show more/show less" in stable

* mixin naming style

* fix buyQuestModal marginTop

* fix customMenuDropdown position

* fix userDropdown items
2017-11-08 18:40:37 +01:00

67 lines
1.6 KiB
Vue

<template lang="pug">
b-modal#quest-completed(v-if='user.party.quest.completed', :title="title",
size='md', :hide-footer="true")
.modal-body.text-center
.quest(:class='`quest_${user.party.quest.completed}`')
p(v-html='questData.completion()')
.quest-rewards.text-center
h3 {{ $t('youReceived') }}
questDialogDrops(:item="questData")
.modal-footer
button.btn.btn-primary(@click='setQuestCompleted()') {{ $t('ok') }}
</template>
<style scoped>
.quest {
margin: 0 auto;
}
.quest-rewards .questRewards {
margin: 0 auto;
}
</style>
<script>
import quests from 'common/script/content/quests';
import questDialogDrops from 'client/components/shops/quests/questDialogDrops';
import { mapState } from 'client/libs/store';
import percent from '../../../common/script/libs/percent';
import { maxHealth } from '../../../common/script/index';
export default {
components: {
questDialogDrops,
},
data () {
return {
maxHealth,
quests,
};
},
computed: {
...mapState({user: 'user.data'}),
questData () {
return this.quests.quests[this.user.party.quest.completed];
},
title () {
return `${this.questData.text()} ${this.$t('completed')}`;
},
barStyle () {
return {
width: `${percent(this.user.stats.hp, maxHealth)}%`,
};
},
},
methods: {
close () {
this.$root.$emit('bv::hide::modal', 'quest-completed');
},
setQuestCompleted () {
this.$store.dispatch('user:set', {'party.quest.completed': ''});
this.close();
},
},
};
</script>