mirror of
https://github.com/wekan/wekan.git
synced 2025-12-28 21:28:49 +01:00
colors: add per list color
Hamburger menu only. Note that I am definitively not responsible for the resulting Christmas tree. fixes #328
This commit is contained in:
parent
78c779faaf
commit
d0a9d8c581
5 changed files with 166 additions and 1 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue