From 3c06529906506f3fd28fb8829578765f3f8cef2c Mon Sep 17 00:00:00 2001 From: Jacob Date: Wed, 9 Aug 2017 10:16:50 +0100 Subject: [PATCH] buffViewList is now split into "Conditions" and "Buffs" --- .../buffs/buffViewList/buffViewList.html | 15 +++++++++++++-- .../character/buffs/buffViewList/buffViewList.js | 14 +++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/rpg-docs/client/views/character/buffs/buffViewList/buffViewList.html b/rpg-docs/client/views/character/buffs/buffViewList/buffViewList.html index 394e7e4e..9998abf1 100644 --- a/rpg-docs/client/views/character/buffs/buffViewList/buffViewList.html +++ b/rpg-docs/client/views/character/buffs/buffViewList/buffViewList.html @@ -4,13 +4,24 @@
Conditions
{{#if canEditCharacter _id}} - + {{/if}}
- {{#each buffs}} + {{#each conditions}} {{>buffView}} {{/each}} + + {{#if buffs.count}} +
+
+ Buffs +
+ {{#each buffs}} + {{> buffView}} + {{/each}} +
+ {/if}}
diff --git a/rpg-docs/client/views/character/buffs/buffViewList/buffViewList.js b/rpg-docs/client/views/character/buffs/buffViewList/buffViewList.js index e2f26d35..af07ae6c 100644 --- a/rpg-docs/client/views/character/buffs/buffViewList/buffViewList.js +++ b/rpg-docs/client/views/character/buffs/buffViewList/buffViewList.js @@ -1,18 +1,22 @@ Template.buffViewList.helpers({ + conditions: function(){ + var selector = { + "charId": this._id, + "type": "inate", + }; + return Buffs.find(selector); + }, buffs: function(){ var selector = { - // "parent.id": this.parentId, "charId": this._id, + "type": "custom", }; - // if (this.parentGroup){ - // selector["parent.group"] = this.parentGroup; - // } return Buffs.find(selector); } }); Template.buffViewList.events({ - "click #addBuff": function(event, template){ + "click #addCondition": function(event, template){ pushDialogStack({ template: "conditionLibraryDialog", element: event.currentTarget,