summaryrefslogtreecommitdiffstats
path: root/models/boards.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-01-25 19:05:44 +0200
committerGitHub <noreply@github.com>2019-01-25 19:05:44 +0200
commit5d6203f5f99d02fc508015c0889977da55eff2f1 (patch)
tree3663d29721ea91df9546bef35cd3896d0fecb1cb /models/boards.js
parent4a2576fbc200d397bcf7cede45316d9fb7e520dd (diff)
parent97d95b4bcbcab86629e368ea41bb9f00450b21f6 (diff)
downloadwekan-5d6203f5f99d02fc508015c0889977da55eff2f1.tar.gz
wekan-5d6203f5f99d02fc508015c0889977da55eff2f1.tar.bz2
wekan-5d6203f5f99d02fc508015c0889977da55eff2f1.zip
Merge pull request #2128 from bentiss/color-lists
Color lists
Diffstat (limited to 'models/boards.js')
-rw-r--r--models/boards.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js
index 99480ca7..b0f5cecb 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -347,10 +347,37 @@ Boards.helpers({
return Lists.find({ boardId: this._id, archived: false }, { sort: { sort: 1 } });
},
+ nullSortLists() {
+ return Lists.find({
+ boardId: this._id,
+ archived: false,
+ sort: { $eq: null },
+ });
+ },
+
swimlanes() {
return Swimlanes.find({ boardId: this._id, archived: false }, { sort: { sort: 1 } });
},
+ nextSwimlane(swimlane) {
+ return Swimlanes.findOne({
+ boardId: this._id,
+ archived: false,
+ sort: { $gte: swimlane.sort },
+ _id: { $ne: swimlane._id },
+ }, {
+ sort: { sort: 1 },
+ });
+ },
+
+ nullSortSwimlanes() {
+ return Swimlanes.find({
+ boardId: this._id,
+ archived: false,
+ sort: { $eq: null },
+ });
+ },
+
hasOvertimeCards(){
const card = Cards.findOne({isOvertime: true, boardId: this._id, archived: false} );
return card !== undefined;