New client misc for days (#8924)

* Removed sticky header

* Fixed group desc and information

* Add flag modal

* Fixed chat sync errors

* Fixed balance display

* Fixed key and close issue

* Updated tavern placeholder

* Added and fixed links

* Removed open user modal from clicking menu

* Added better app loading check

* Removed banner from party

* Allowed for nav when clicking the card

* Fixed member display

* Updated create challenge modal to populate list and to create party/public

* Display members modal

* Added fetch recent messages
This commit is contained in:
Keith Holliday
2017-08-03 14:04:03 -06:00
committed by GitHub
parent e61884ed08
commit 75913842bc
13 changed files with 223 additions and 96 deletions

View File

@@ -1,26 +1,29 @@
<template lang="pug">
div
challenge-modal
challenge-modal(:groupId='groupId', v-on:createChallenge='challengeCreated')
.row.no-quest-section(v-if='challenges.length === 0')
.col-12.text-center
.svg-icon.challenge-icon(v-html="icons.challengeIcon")
h4(v-once) {{ $t('haveNoChallenges') }}
p(v-once) {{ $t('challengeDescription') }}
button.btn.btn-secondary(v-once, @click='createChallenge()') {{ $t('createChallenge') }}
.col-12.challenge-item(v-for='challenge in challenges')
.row
.col-9
router-link.title(:to="{ name: 'challenge', params: { challengeId: challenge._id } }")
strong {{challenge.name}}
p {{challenge.description}}
div
.svg-icon.member-icon(v-html="icons.memberIcon")
.member-count {{challenge.memberCount}}
.col-3
div
span.svg-icon.gem(v-html="icons.gemIcon")
span.prize {{challenge.prize}}
div.prize-title Prize
router-link.title(:to="{ name: 'challenge', params: { challengeId: challenge._id } }", v-for='challenge in challenges')
.col-12.challenge-item
.row
.col-9
router-link.title(:to="{ name: 'challenge', params: { challengeId: challenge._id } }")
strong {{challenge.name}}
p {{challenge.description}}
div
.svg-icon.member-icon(v-html="icons.memberIcon")
.member-count {{challenge.memberCount}}
.col-3
div
span.svg-icon.gem(v-html="icons.gemIcon")
span.prize {{challenge.prize}}
div.prize-title Prize
.col-12.text-center
button.btn.btn-secondary(@click='createChallenge()') {{ $t('createChallenge') }}
</template>
<style>
@@ -79,6 +82,7 @@ div
<script>
import challengeModal from './challengeModal';
import { mapState } from 'client/libs/store';
import gemIcon from 'assets/svg/gem.svg';
import memberIcon from 'assets/svg/member-icon.svg';
@@ -89,8 +93,13 @@ export default {
components: {
challengeModal,
},
computed: {
...mapState({user: 'user.data'}),
},
async mounted () {
this.challenges = await this.$store.dispatch('challenges:getGroupChallenges', {groupId: this.groupId});
this.groupIdForChallenges = this.groupId;
if (this.user.party._id) this.groupIdForChallenges = this.user.party._id;
this.challenges = await this.$store.dispatch('challenges:getGroupChallenges', {groupId: this.groupIdForChallenges});
},
data () {
return {
@@ -100,12 +109,17 @@ export default {
memberIcon,
gemIcon,
}),
groupIdForChallenges: '',
};
},
methods: {
createChallenge () {
this.$root.$emit('show::modal', 'challenge-modal');
},
challengeCreated (challenge) {
if (challenge.group._id !== this.groupIdForChallenges) return;
this.challenges.push(challenge);
},
},
};
</script>