most work concluded, code needs clean up, further testing required

This commit is contained in:
amadilsons 2017-10-04 17:48:37 +02:00
parent 089dbf0cf6
commit c865bfe497
9 changed files with 72 additions and 88 deletions

View file

@ -96,6 +96,15 @@ BlazeComponent.extendComponent({
MultiSelection.toggle(this.currentData()._id);
},
canSeeAddCard() {
return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
},
reachedWipLimit() {
const list = Template.currentData();
return list.wipLimit.enabled && list.wipLimit.value == list.cards().count();
},
events() {
return [{
'click .js-minicard': this.clickOnMiniCard,
@ -239,10 +248,3 @@ BlazeComponent.extendComponent({
});
},
}).register('addCardForm');
Template.listBody.helpers({
canSeeAddCard() {
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
},
});