mirror of
https://github.com/wekan/wekan.git
synced 2026-02-15 04:28:07 +01:00
Add two way binding of activities, comments, and attachments
This commit is contained in:
parent
49c415f023
commit
74a01691e3
4 changed files with 46 additions and 10 deletions
|
|
@ -181,19 +181,33 @@ Cards.helpers({
|
|||
},
|
||||
|
||||
isAssigned(memberId) {
|
||||
return _.contains(this.members, memberId);
|
||||
return _.contains(this.getMembers(), memberId);
|
||||
},
|
||||
|
||||
activities() {
|
||||
return Activities.find({cardId: this._id}, {sort: {createdAt: -1}});
|
||||
if (this.isImportedCard()) {
|
||||
return Activities.find({cardId: this.importedId}, {sort: {createdAt: -1}});
|
||||
} else if (this.isImportedBoard()) {
|
||||
return Activities.find({boardId: this.importedId}, {sort: {createdAt: -1}});
|
||||
} else {
|
||||
return Activities.find({cardId: this._id}, {sort: {createdAt: -1}});
|
||||
}
|
||||
},
|
||||
|
||||
comments() {
|
||||
return CardComments.find({cardId: this._id}, {sort: {createdAt: -1}});
|
||||
if (this.isImportedCard()) {
|
||||
return CardComments.find({cardId: this.importedId}, {sort: {createdAt: -1}});
|
||||
} else {
|
||||
return CardComments.find({cardId: this._id}, {sort: {createdAt: -1}});
|
||||
}
|
||||
},
|
||||
|
||||
attachments() {
|
||||
return Attachments.find({cardId: this._id}, {sort: {uploadedAt: -1}});
|
||||
if (this.isImportedCard()) {
|
||||
return Attachments.find({cardId: this.importedId}, {sort: {uploadedAt: -1}});
|
||||
} else {
|
||||
return Attachments.find({cardId: this._id}, {sort: {uploadedAt: -1}});
|
||||
}
|
||||
},
|
||||
|
||||
cover() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue