summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/lists.js7
-rw-r--r--models/swimlanes.js22
2 files changed, 29 insertions, 0 deletions
diff --git a/models/lists.js b/models/lists.js
index e0040752..a0b882bc 100644
--- a/models/lists.js
+++ b/models/lists.js
@@ -27,6 +27,13 @@ Lists.attachSchema(new SimpleSchema({
*/
type: String,
},
+ swimlaneId: {
+ /**
+ * the swimalen associated to this list. Used for templates
+ */
+ type: String,
+ defaultValue: '',
+ },
createdAt: {
/**
* creation date
diff --git a/models/swimlanes.js b/models/swimlanes.js
index 185422ce..9d4e16de 100644
--- a/models/swimlanes.js
+++ b/models/swimlanes.js
@@ -108,6 +108,13 @@ Swimlanes.helpers({
}), { sort: ['sort'] });
},
+ lists() {
+ return Lists.find(Filter.mongoSelector({
+ swimlaneId: this._id,
+ archived: false,
+ }), { sort: ['sort'] });
+ },
+
allCards() {
return Cards.find({ swimlaneId: this._id });
},
@@ -129,6 +136,21 @@ Swimlanes.helpers({
isTemplateContainer() {
return this.type === 'template-container';
},
+
+ isListTemplatesSwimlane() {
+ const user = Users.findOne(Meteor.userId());
+ return user.profile.listTemplatesSwimlaneId === this._id;
+ },
+
+ isCardTemplatesSwimlane() {
+ const user = Users.findOne(Meteor.userId());
+ return user.profile.cardTemplatesSwimlaneId === this._id;
+ },
+
+ isBoardTemplatesSwimlane() {
+ const user = Users.findOne(Meteor.userId());
+ return user.profile.boardsTemplatesSwimlaneId === this._id;
+ },
});
Swimlanes.mutations({