mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Added Tavern case
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
.owner-item
|
.owner-item
|
||||||
strong {{ $t('createdBy') }}:
|
strong {{ $t('createdBy') }}:
|
||||||
user-link.mx-1(:user="challenge.leader")
|
user-link.mx-1(:user="challenge.leader")
|
||||||
.owner-item(v-if="challenge.group && challenge.group.name !== 'Tavern'")
|
.owner-item(v-if="challenge.group && !isTavern(challenge.group)")
|
||||||
strong {{ $t(challenge.group.type) }}:
|
strong {{ $t(challenge.group.type) }}:
|
||||||
group-link.mx-1(:group="challenge.group")
|
group-link.mx-1(:group="challenge.group")
|
||||||
.meta
|
.meta
|
||||||
@@ -212,6 +212,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { TAVERN_ID } from '../../../common/script/constants';
|
||||||
import {mapState} from 'client/libs/store';
|
import {mapState} from 'client/libs/store';
|
||||||
import userLink from '../userLink';
|
import userLink from '../userLink';
|
||||||
import groupLink from '../groupLink';
|
import groupLink from '../groupLink';
|
||||||
@@ -265,6 +266,9 @@
|
|||||||
isOfficial (category) {
|
isOfficial (category) {
|
||||||
return category.name === 'habitica_official';
|
return category.name === 'habitica_official';
|
||||||
},
|
},
|
||||||
|
isTavern (group) {
|
||||||
|
return group._id === TAVERN_ID;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,16 +3,19 @@
|
|||||||
v-if='group',
|
v-if='group',
|
||||||
@click.prevent='goToGroup'
|
@click.prevent='goToGroup'
|
||||||
) {{group.name}}
|
) {{group.name}}
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { TAVERN_ID } from '../../common/script/constants';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['group'],
|
props: ['group'],
|
||||||
methods: {
|
methods: {
|
||||||
goToGroup () {
|
goToGroup () {
|
||||||
if (this.group.type === 'party') {
|
if (this.group.type === 'party') {
|
||||||
this.$router.push({name: 'party'});
|
this.$router.push({name: 'party'});
|
||||||
|
} else if (this.group._id === TAVERN_ID) {
|
||||||
|
this.$router.push({name: 'tavern'});
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({name: 'guild', params: {groupId: this.group._id}});
|
this.$router.push({name: 'guild', params: {groupId: this.group._id}});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user