2017-08-01 18:52:49 +00:00
|
|
|
<template lang="pug">
|
2017-08-30 22:59:31 +00:00
|
|
|
b-modal#new-stuff(
|
|
|
|
|
v-if='user.flags.newStuff',
|
|
|
|
|
size='lg',
|
|
|
|
|
:hide-header='true',
|
|
|
|
|
:hide-footer='true',
|
|
|
|
|
)
|
|
|
|
|
.modal-body
|
2017-09-30 15:48:24 +00:00
|
|
|
new-stuff
|
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>
|
|
|
|
|
|
2017-08-30 22:59:31 +00:00
|
|
|
<style lang='scss' scoped>
|
|
|
|
|
@import '~client/assets/scss/static.scss';
|
|
|
|
|
|
|
|
|
|
.modal-body {
|
|
|
|
|
padding-top: 2em;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
2017-08-01 18:52:49 +00:00
|
|
|
<script>
|
2017-10-20 13:22:13 +00:00
|
|
|
// import axios from 'axios';
|
2017-09-30 15:48:24 +00:00
|
|
|
import bModal from 'bootstrap-vue/lib/components/modal';
|
|
|
|
|
import { mapState } from 'client/libs/store';
|
|
|
|
|
import markdown from 'client/directives/markdown';
|
|
|
|
|
import newStuff from 'client/components/static/newStuff';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
bModal,
|
|
|
|
|
newStuff,
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapState({user: 'user.data'}),
|
|
|
|
|
},
|
|
|
|
|
directives: {
|
|
|
|
|
markdown,
|
2017-08-01 18:52:49 +00:00
|
|
|
},
|
2017-10-20 13:22:13 +00:00
|
|
|
mounted () {
|
|
|
|
|
this.$root.$on('show::modal', async (modalId) => {
|
|
|
|
|
if (modalId !== 'new-stuff') return;
|
|
|
|
|
// Request the lastest news, but not locally incase they don't refresh
|
|
|
|
|
// let response = await axios.get('/static/new-stuff');
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
destroyed () {
|
|
|
|
|
this.$root.$off('show::modal');
|
|
|
|
|
},
|
2017-09-30 15:48:24 +00:00
|
|
|
methods: {
|
|
|
|
|
close () {
|
|
|
|
|
this.$root.$emit('hide::modal', 'new-stuff');
|
|
|
|
|
},
|
|
|
|
|
dismissAlert () {
|
|
|
|
|
this.$store.dispatch('user:set', {'flags.newStuff': false});
|
|
|
|
|
this.close();
|
|
|
|
|
},
|
2017-08-26 02:56:21 +00:00
|
|
|
},
|
2017-09-30 15:48:24 +00:00
|
|
|
};
|
2017-08-01 18:52:49 +00:00
|
|
|
</script>
|