diff options
author | Angelo Gallarello <angelo.gallarell@gmail.com> | 2018-08-03 20:43:37 +0200 |
---|---|---|
committer | Angelo Gallarello <angelo.gallarell@gmail.com> | 2018-08-03 20:43:37 +0200 |
commit | 7e4bd4a0a753531c2716ff39ce88f05b7fc30c0d (patch) | |
tree | d826ff275419313bb81ad18802da96f4ecbd93c0 /client/components/rules | |
parent | f63482b58775a2f52fdd5f932ce7d14f16757133 (diff) | |
download | wekan-7e4bd4a0a753531c2716ff39ce88f05b7fc30c0d.tar.gz wekan-7e4bd4a0a753531c2716ff39ce88f05b7fc30c0d.tar.bz2 wekan-7e4bd4a0a753531c2716ff39ce88f05b7fc30c0d.zip |
Add and remove ui
Diffstat (limited to 'client/components/rules')
-rw-r--r-- | client/components/rules/rules.jade | 10 | ||||
-rw-r--r-- | client/components/rules/rules.js | 30 |
2 files changed, 20 insertions, 20 deletions
diff --git a/client/components/rules/rules.jade b/client/components/rules/rules.jade index 8f482b06..6b49b5a7 100644 --- a/client/components/rules/rules.jade +++ b/client/components/rules/rules.jade @@ -5,23 +5,23 @@ template(name="rules") | Project rules ul.rules-lists - each triggers + each rules li.rules-lists-item p - = toId + = title div.rules-btns-group button i.fa.fa-eye | View rule - button + button.js-delete-rule i.fa.fa-trash-o | Delete rule else li.no-items-message No rules div.rules-add - button + button.js-add-rule i.fa.fa-plus | Add rule - input(type=text) + input(type=text,placeholder="New rule name",id="ruleTitle") diff --git a/client/components/rules/rules.js b/client/components/rules/rules.js index e679431a..ed781f9a 100644 --- a/client/components/rules/rules.js +++ b/client/components/rules/rules.js @@ -1,25 +1,25 @@ BlazeComponent.extendComponent({ onCreated() { - this.subscribe('allTriggers'); + this.subscribe('allRules'); }, - triggers() { - return Triggers.find({}); + rules() { + return Rules.find({}); }, events() { - return [{'click .js-add-trigger'(event) { + return [{'click .js-delete-rule'(event) { + const rule = this.currentData(); + Rules.remove(rule._id); + + }, + 'click .js-add-rule'(event) { event.preventDefault(); - const toName = this.find('#toName').value; - const fromName = this.find('#fromName').value; - const toId = Triggers.findOne().findList(toName)._id; - const fromId = Triggers.findOne().findList(fromName)._id; - console.log(toId); - console.log(fromId); - Triggers.insert({group: "cards", activityType: "moveCard","fromId":fromId,"toId":toId }); - + const ruleTitle = this.find('#ruleTitle').value; + Rules.insert({title: ruleTitle}); + this.find('#ruleTitle').value = ""; - },}]; - }, -}).register('rules'); + }}]; + }, + }).register('rules'); |