summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorThuan Pham Quoc <thuanpq.io@gmail.com>2017-11-20 23:24:27 +0700
committerThuan Pham Quoc <thuanpq.io@gmail.com>2017-11-20 23:24:27 +0700
commit6dba4ccd4d0c8d7443e7d9c39ddafed2b8f1b6ca (patch)
tree670e4808cd4fe1563a01f5f6821ae2f6e8e97a20 /models
parentd38071457ce1ae722d025216fb2bf6ba958697ac (diff)
downloadwekan-6dba4ccd4d0c8d7443e7d9c39ddafed2b8f1b6ca.tar.gz
wekan-6dba4ccd4d0c8d7443e7d9c39ddafed2b8f1b6ca.tar.bz2
wekan-6dba4ccd4d0c8d7443e7d9c39ddafed2b8f1b6ca.zip
Added red-green circle to board lists item for indicating board which has overtime logs or normal spent time log
Diffstat (limited to 'models')
-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 } });
},