mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user