summaryrefslogtreecommitdiffstats
path: root/models/lists.js
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-25 15:56:40 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-25 15:56:40 +0100
commitd0a9d8c581f9356f5e72ccb698fc3963c59e96cd (patch)
tree71acc37690c94fd446411fcdbfb3ac72c2c4878a /models/lists.js
parent78c779faafad2010842bfccca9ef5c483530c892 (diff)
downloadwekan-d0a9d8c581f9356f5e72ccb698fc3963c59e96cd.tar.gz
wekan-d0a9d8c581f9356f5e72ccb698fc3963c59e96cd.tar.bz2
wekan-d0a9d8c581f9356f5e72ccb698fc3963c59e96cd.zip
colors: add per list color
Hamburger menu only. Note that I am definitively not responsible for the resulting Christmas tree. fixes #328
Diffstat (limited to 'models/lists.js')
-rw-r--r--models/lists.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/models/lists.js b/models/lists.js
index 39ff130a..54e7d037 100644
--- a/models/lists.js
+++ b/models/lists.js
@@ -92,6 +92,21 @@ Lists.attachSchema(new SimpleSchema({
type: Boolean,
defaultValue: false,
},
+ color: {
+ /**
+ * the color of the list
+ */
+ type: String,
+ optional: true,
+ // silver is the default, so it is left out
+ allowedValues: [
+ 'white', 'green', 'yellow', 'orange', 'red', 'purple',
+ 'blue', 'sky', 'lime', 'pink', 'black',
+ 'peachpuff', 'crimson', 'plum', 'darkgreen',
+ 'slateblue', 'magenta', 'gold', 'navy', 'gray',
+ 'saddlebrown', 'paleturquoise', 'mistyrose', 'indigo',
+ ],
+ },
}));
Lists.allow({
@@ -148,6 +163,12 @@ Lists.helpers({
return list.wipLimit[option] ? list.wipLimit[option] : 0; // Necessary check to avoid exceptions for the case where the doc doesn't have the wipLimit field yet set
}
},
+
+ colorClass() {
+ if (this.color)
+ return this.color;
+ return '';
+ },
});
Lists.mutations({
@@ -174,6 +195,17 @@ Lists.mutations({
setWipLimit(limit) {
return { $set: { 'wipLimit.value': limit } };
},
+
+ setColor(newColor) {
+ if (newColor === 'silver') {
+ newColor = null;
+ }
+ return {
+ $set: {
+ color: newColor,
+ },
+ };
+ },
});
Meteor.methods({