summaryrefslogtreecommitdiffstats
path: root/models/boards.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-11-21 11:31:04 +0200
committerLauri Ojansivu <x@xet7.org>2017-11-21 11:31:04 +0200
commit9ea35b7188ca39a092755002c1cc5e97fee43a02 (patch)
treef5359aa002dcba218748de997d1f92a451d6c2a4 /models/boards.js
parentf3e7646cfa065ceea0cf1aaff1f5adbde457a32a (diff)
parentd76387aed2c83a5876b2777598be6d534530cf4e (diff)
downloadwekan-9ea35b7188ca39a092755002c1cc5e97fee43a02.tar.gz
wekan-9ea35b7188ca39a092755002c1cc5e97fee43a02.tar.bz2
wekan-9ea35b7188ca39a092755002c1cc5e97fee43a02.zip
Merge branch 'thuanpq-card-spent-time' into devel
Spent time/Overtime on card. Thanks to thuanpq ! Closes #1337
Diffstat (limited to 'models/boards.js')
-rw-r--r--models/boards.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js
index 6ae818c6..594bb7b9 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -187,6 +187,16 @@ Boards.helpers({
return Lists.find({ boardId: this._id, archived: false }, { sort: { sort: 1 } });
},
+ hasOvertimeCards(){
+ const card = Cards.findOne({isOvertime: true, boardId: this._id, archived: false} );
+ return card !== undefined;
+ },
+
+ hasSpentTimeCards(){
+ const card = Cards.findOne({spentTime: { $gt: 0 }, boardId: this._id, archived: false} );
+ return card !== undefined;
+ },
+
activities() {
return Activities.find({ boardId: this._id }, { sort: { createdAt: -1 } });
},