Joined and Owned Challenges should still appear in Discover, but annotated with status (#9956)

This commit is contained in:
Marvin Rabe
2018-05-07 16:03:15 +02:00
parent 1896a8fab0
commit 0d84643961
5 changed files with 28 additions and 18 deletions

View File

@@ -26,7 +26,7 @@
.svg-icon(v-html="icons.calendarIcon")
strong.mx-1 {{ $t('endDate')}}:
span {{challenge.endDate}}
category-tags.challenge-categories(:categories="challenge.categories", :owner-id="challenge.leader._id", v-once)
category-tags.challenge-categories(:categories="challenge.categories", :owner="isOwner", :member="isMember" v-once)
.challenge-description {{challenge.summary}}
.well-wrapper(v-if="fullLayout")
.well
@@ -195,6 +195,7 @@
import groupLink from '../groupLink';
import categoryTags from '../categories/categoryTags';
import markdownDirective from 'client/directives/markdown';
import {mapState} from 'client/libs/store';
import gemIcon from 'assets/svg/gem.svg';
import memberIcon from 'assets/svg/member-icon.svg';
@@ -231,6 +232,13 @@
};
},
computed: {
...mapState({user: 'user.data'}),
isOwner () {
return this.challenge.leader && this.challenge.leader._id === this.user._id;
},
isMember () {
return this.user.challenges.indexOf(this.challenge._id) !== -1;
},
tasksData () {
return [
{