summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-01-22 15:22:31 +0200
committerLauri Ojansivu <x@xet7.org>2019-01-22 15:22:31 +0200
commit44e4df2492b95226f1297e7f556d61b1afaab714 (patch)
tree7538572b2094f80e87f16af29919e5878d9554c2
parentd8482b533a3d525071d5733df9e38629da5b8342 (diff)
downloadwekan-44e4df2492b95226f1297e7f556d61b1afaab714.tar.gz
wekan-44e4df2492b95226f1297e7f556d61b1afaab714.tar.bz2
wekan-44e4df2492b95226f1297e7f556d61b1afaab714.zip
- Translate and add colors to IFTTT Rules dropdown.
Thanks to xet7 !
-rw-r--r--client/components/cards/cardDetails.js2
-rw-r--r--client/components/rules/triggers/cardTriggers.jade32
-rw-r--r--client/components/rules/triggers/cardTriggers.js3
3 files changed, 19 insertions, 18 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index c936f0f4..cc04b830 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -3,7 +3,7 @@ const { calculateIndexData, enableClickOnTouch } = Utils;
let cardColors;
Meteor.startup(() => {
- cardColors = Cards.simpleSchema()._schema['color'].allowedValues;
+ cardColors = Cards.simpleSchema()._schema.color.allowedValues;
});
BlazeComponent.extendComponent({
diff --git a/client/components/rules/triggers/cardTriggers.jade b/client/components/rules/triggers/cardTriggers.jade
index 4492502b..72c4b8db 100644
--- a/client/components/rules/triggers/cardTriggers.jade
+++ b/client/components/rules/triggers/cardTriggers.jade
@@ -1,13 +1,13 @@
template(name="cardTriggers")
div.trigger-item
div.trigger-content
- div.trigger-text
+ div.trigger-text
| {{_'r-when-a-label-is'}}
div.trigger-dropdown
select(id="label-action")
option(value="added") {{_'r-added-to'}}
option(value="removed") {{_'r-removed-from'}}
- div.trigger-text
+ div.trigger-text
| {{_'r-a-card'}}
div.trigger-button.trigger-button-person.js-show-user-field
i.fa.fa-user
@@ -21,20 +21,20 @@ template(name="cardTriggers")
div.trigger-item
div.trigger-content
- div.trigger-text
+ div.trigger-text
| {{_'r-when-the-label-is'}}
div.trigger-dropdown
select(id="spec-label")
each labels
- option(value="#{_id}")
- = name
- div.trigger-text
+ option(value="#{_id}" style="background-color: #{name}")
+ = translatedname
+ div.trigger-text
| {{_'r-is'}}
div.trigger-dropdown
select(id="spec-label-action")
option(value="added") {{_'r-added-to'}}
option(value="removed") {{_'r-removed-from'}}
- div.trigger-text
+ div.trigger-text
| {{_'r-a-card'}}
div.trigger-button.trigger-button-person.js-show-user-field
i.fa.fa-user
@@ -48,13 +48,13 @@ template(name="cardTriggers")
div.trigger-item
div.trigger-content
- div.trigger-text
+ div.trigger-text
| {{_'r-when-a-member'}}
div.trigger-dropdown
select(id="gen-member-action")
option(value="added") {{_'r-added-to'}}
option(value="removed") {{_'r-removed-from'}}
- div.trigger-text
+ div.trigger-text
| {{_'r-a-card'}}
div.trigger-button.trigger-button-person.js-show-user-field
i.fa.fa-user
@@ -69,17 +69,17 @@ template(name="cardTriggers")
div.trigger-item
div.trigger-content
- div.trigger-text
+ div.trigger-text
| {{_'r-when-the-member'}}
div.trigger-dropdown
- input(id="spec-member",type=text,placeholder="{{_'r-name'}}")
- div.trigger-text
+ input(id="spec-member",type=text,placeholder="{{_'r-name'}}")
+ div.trigger-text
| {{_'r-is'}}
div.trigger-dropdown
select(id="spec-member-action")
option(value="added") {{_'r-added-to'}}
option(value="removed") {{_'r-removed-from'}}
- div.trigger-text
+ div.trigger-text
| {{_'r-a-card'}}
div.trigger-button.trigger-button-person.js-show-user-field
i.fa.fa-user
@@ -93,15 +93,15 @@ template(name="cardTriggers")
div.trigger-item
div.trigger-content
- div.trigger-text
+ div.trigger-text
| {{_'r-when-a-attach'}}
- div.trigger-text
+ div.trigger-text
| {{_'r-is'}}
div.trigger-dropdown
select(id="attach-action")
option(value="added") {{_'r-added-to'}}
option(value="removed") {{_'r-removed-from'}}
- div.trigger-text
+ div.trigger-text
| {{_'r-a-card'}}
div.trigger-button.trigger-button-person.js-show-user-field
i.fa.fa-user
diff --git a/client/components/rules/triggers/cardTriggers.js b/client/components/rules/triggers/cardTriggers.js
index 2303a85b..ca282fa7 100644
--- a/client/components/rules/triggers/cardTriggers.js
+++ b/client/components/rules/triggers/cardTriggers.js
@@ -6,7 +6,8 @@ BlazeComponent.extendComponent({
const labels = Boards.findOne(Session.get('currentBoard')).labels;
for (let i = 0; i < labels.length; i++) {
if (labels[i].name === '' || labels[i].name === undefined) {
- labels[i].name = labels[i].color.toUpperCase();
+ labels[i].name = labels[i].color;
+ labels[i].translatedname = `${TAPi18n.__(`color-${ labels[i].color}`)}`;
}
}
return labels;