diff options
Diffstat (limited to 'client/components')
-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'); |