mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
count subtasks just like checklists
This commit is contained in:
parent
9a2d3e15e8
commit
63c1bb9e17
2 changed files with 26 additions and 26 deletions
|
@ -129,3 +129,8 @@ template(name="minicard")
|
|||
.badge(class="{{#if checklistFinished}}is-finished{{/if}}")
|
||||
span.badge-icon.fa.fa-check-square-o
|
||||
span.badge-text.check-list-text {{checklistFinishedCount}}/{{checklistItemCount}}
|
||||
if allSubtasks.count
|
||||
.badge
|
||||
span.badge-icon.fa.fa-sitemap
|
||||
span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}}
|
||||
//{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down
|
||||
|
|
|
@ -641,37 +641,32 @@ Cards.helpers({
|
|||
);
|
||||
},
|
||||
|
||||
allSubtasks() {
|
||||
return Cards.find(
|
||||
{
|
||||
parentId: this._id,
|
||||
archived: false,
|
||||
},
|
||||
{
|
||||
sort: {
|
||||
sort: 1,
|
||||
},
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
subtasksCount() {
|
||||
return Cards.find({
|
||||
parentId: this._id,
|
||||
archived: false,
|
||||
}).count();
|
||||
},
|
||||
|
||||
subtasksFinishedCount() {
|
||||
subtasksFinished() {
|
||||
return Cards.find({
|
||||
parentId: this._id,
|
||||
archived: true,
|
||||
}).count();
|
||||
});
|
||||
},
|
||||
|
||||
subtasksFinished() {
|
||||
const finishCount = this.subtasksFinishedCount();
|
||||
return finishCount > 0 && this.subtasksCount() === finishCount;
|
||||
allSubtasks() {
|
||||
return Cards.find({
|
||||
parentId: this._id
|
||||
});
|
||||
},
|
||||
|
||||
subtasksCount() {
|
||||
const subtasks = this.subtasks();
|
||||
return subtasks.count();
|
||||
},
|
||||
|
||||
subtasksFinishedCount() {
|
||||
const subtasksArchived = this.subtasksFinished();
|
||||
return subtasksArchived.count();
|
||||
},
|
||||
|
||||
allSubtasksCount() {
|
||||
const allSubtasks = this.allSubtasks();
|
||||
return allSubtasks.count();
|
||||
},
|
||||
|
||||
allowsSubtasks() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue