2017-08-01 18:52:49 +00:00
|
|
|
<template lang="pug">
|
2017-08-26 02:56:21 +00:00
|
|
|
b-modal#new-stuff(v-if='user.flags.newStuff', :title="$t('newStuff')", size='lg', :hide-footer="true")
|
|
|
|
|
.modal-body.new-stuff-modal
|
|
|
|
|
h3.text-center
|
|
|
|
|
| {{ this.$t('newStuff') }} by
|
|
|
|
|
a(target='_blank', href='https://twitter.com/Mihakuu') Bailey
|
2017-08-01 18:52:49 +00:00
|
|
|
div(:class="baileyClass")
|
2017-08-26 02:56:21 +00:00
|
|
|
div(v-html='latestBaileyMessage')
|
2017-08-01 18:52:49 +00:00
|
|
|
.modal-footer
|
|
|
|
|
a.btn.btn-info(href='http://habitica.wikia.com/wiki/Whats_New', target='_blank') {{ this.$t('newsArchive') }}
|
|
|
|
|
button.btn.btn-default(@click='close()') {{ this.$t('cool') }}
|
2017-08-26 02:56:21 +00:00
|
|
|
button.btn.btn-warning(@click='dismissAlert();') {{ this.$t('dismissAlert') }}
|
2017-08-01 18:52:49 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2017-08-26 02:56:21 +00:00
|
|
|
import axios from 'axios';
|
2017-08-01 18:52:49 +00:00
|
|
|
import bModal from 'bootstrap-vue/lib/components/modal';
|
2017-08-26 02:56:21 +00:00
|
|
|
import { mapState } from 'client/libs/store';
|
2017-08-01 18:52:49 +00:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
bModal,
|
|
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
let worldDmg = {
|
|
|
|
|
bailey: true,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
baileyClass: {
|
|
|
|
|
'npc_bailey_broken': worldDmg.bailey, // eslint-disable-line
|
|
|
|
|
'npc_bailey': !worldDmg.bailey, // eslint-disable-line
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
2017-08-26 02:56:21 +00:00
|
|
|
computed: {
|
|
|
|
|
...mapState({user: 'user.data'}),
|
|
|
|
|
async latestBaileyMessage () {
|
|
|
|
|
let message = await axios.get('/new-stuff');
|
|
|
|
|
return message;
|
|
|
|
|
},
|
2017-08-01 18:52:49 +00:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
close () {
|
|
|
|
|
this.$root.$emit('hide::modal', 'new-stuff');
|
|
|
|
|
},
|
2017-08-26 02:56:21 +00:00
|
|
|
dismissAlert () {
|
|
|
|
|
this.$store.dispatch('user:set', {'flags.newStuff': false});
|
|
|
|
|
this.close();
|
|
|
|
|
},
|
2017-08-01 18:52:49 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|