|
|
|
@ -641,37 +641,32 @@ Cards.helpers({ |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
allSubtasks() { |
|
|
|
|
return Cards.find( |
|
|
|
|
{ |
|
|
|
|
parentId: this._id, |
|
|
|
|
archived: false, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
sort: { |
|
|
|
|
sort: 1, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
subtasksFinished() { |
|
|
|
|
return Cards.find({ |
|
|
|
|
parentId: this._id, |
|
|
|
|
archived: true, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
subtasksCount() { |
|
|
|
|
allSubtasks() { |
|
|
|
|
return Cards.find({ |
|
|
|
|
parentId: this._id, |
|
|
|
|
archived: false, |
|
|
|
|
}).count(); |
|
|
|
|
parentId: this._id |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
subtasksCount() { |
|
|
|
|
const subtasks = this.subtasks(); |
|
|
|
|
return subtasks.count(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
subtasksFinishedCount() { |
|
|
|
|
return Cards.find({ |
|
|
|
|
parentId: this._id, |
|
|
|
|
archived: true, |
|
|
|
|
}).count(); |
|
|
|
|
const subtasksArchived = this.subtasksFinished(); |
|
|
|
|
return subtasksArchived.count(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
subtasksFinished() { |
|
|
|
|
const finishCount = this.subtasksFinishedCount(); |
|
|
|
|
return finishCount > 0 && this.subtasksCount() === finishCount; |
|
|
|
|
allSubtasksCount() { |
|
|
|
|
const allSubtasks = this.allSubtasks(); |
|
|
|
|
return allSubtasks.count(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
allowsSubtasks() { |
|
|
|
|