mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
add action: set card color
This commit is contained in:
parent
3368ebf067
commit
f4f0f489eb
4 changed files with 57 additions and 6 deletions
|
@ -35,9 +35,36 @@ template(name="cardActions")
|
|||
div.trigger-button.js-add-removeall-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-set-color'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="color-action")
|
||||
option(value="white") {{{_'color-white'}}}
|
||||
option(value="green") {{{_'color-green'}}}
|
||||
option(value="yellow") {{{_'color-yellow'}}}
|
||||
option(value="orange") {{{_'color-orange'}}}
|
||||
option(value="red") {{{_'color-red'}}}
|
||||
option(value="purple") {{{_'color-purple'}}}
|
||||
option(value="blue") {{{_'color-blue'}}}
|
||||
option(value="sky") {{{_'color-sky'}}}
|
||||
option(value="lime") {{{_'color-lime'}}}
|
||||
option(value="pink") {{{_'color-pink'}}}
|
||||
option(value="black") {{{_'color-black'}}}
|
||||
option(value="silver") {{{_'color-silver'}}}
|
||||
option(value="peachpuff") {{{_'color-peachpuff'}}}
|
||||
option(value="crimson") {{{_'color-crimson'}}}
|
||||
option(value="plum") {{{_'color-plum'}}}
|
||||
option(value="darkgreen") {{{_'color-darkgreen'}}}
|
||||
option(value="slateblue") {{{_'color-slateblue'}}}
|
||||
option(value="magenta") {{{_'color-magenta'}}}
|
||||
option(value="gold") {{{_'color-gold'}}}
|
||||
option(value="navy") {{{_'color-navy'}}}
|
||||
option(value="gray") {{{_'color-gray'}}}
|
||||
option(value="saddlebrown") {{{_'color-saddlebrown'}}}
|
||||
option(value="paleturquoise") {{{_'color-paleturquoise'}}}
|
||||
option(value="mistyrose") {{{_'color-mistyrose'}}}
|
||||
option(value="indigo") {{{_'color-indigo'}}}
|
||||
div.trigger-button.js-set-color-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
|
|
@ -112,6 +112,26 @@ BlazeComponent.extendComponent({
|
|||
boardId,
|
||||
});
|
||||
},
|
||||
'click .js-set-color-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const selectedColor = this.find('#color-action').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: 'setColor',
|
||||
selectedColor,
|
||||
boardId,
|
||||
desc,
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId,
|
||||
actionId,
|
||||
boardId,
|
||||
});
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
|
|
|
@ -597,6 +597,7 @@
|
|||
"r-label": "label",
|
||||
"r-member": "member",
|
||||
"r-remove-all": "Remove all members from the card",
|
||||
"r-set-color": "Set color to",
|
||||
"r-checklist": "checklist",
|
||||
"r-check-all": "Check all",
|
||||
"r-uncheck-all": "Uncheck all",
|
||||
|
|
|
@ -87,6 +87,9 @@ RulesHelper = {
|
|||
if(action.actionType === 'unarchive'){
|
||||
card.restore();
|
||||
}
|
||||
if(action.actionType === 'setColor'){
|
||||
card.setColor(action.selectedColor);
|
||||
}
|
||||
if(action.actionType === 'addLabel'){
|
||||
card.addLabel(action.labelId);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue