Group plan fixes (#9518)

* Fixed group plan editing

* Added translations

* Abstracted query for group or challenge tasks
This commit is contained in:
Keith Holliday
2017-11-17 20:31:39 +11:00
committed by GitHub
parent 0c713ab368
commit 67564317fb
6 changed files with 54 additions and 71 deletions

View File

@@ -27,11 +27,11 @@ export default {
let userIsRequesting = this.task.group.approvals && this.task.group.approvals.indexOf(this.user._id) !== -1;
if (approvalsLength === 1 && !userIsRequesting) {
return `${approvals[0].userId.profile.name} requests approval`;
return this.$t('youAreRequestingApproval', {userName: approvals[0].userId.profile.name});
} else if (approvalsLength > 1 && !userIsRequesting) {
return `${approvalsLength} request approval`;
return this.$t('youAreRequestingApproval', {userCount: approvalsLength});
} else if (approvalsLength === 1 && userIsRequesting) {
return 'You are requesting approval';
return this.$t('youAreRequestingApproval');
}
},
userIsAdmin () {