- {{#if sourceId}}
-
{{sourceName}}
- {{else}}
+ {{#with statName}}
{{statName}}
- {{/if}}
+ {{else}}
+
{{sourceName}}
+ {{/with}}
{{operationName}}
{{statValue}}
diff --git a/rpg-docs/client/views/character/effects/effectView/effectView.js b/rpg-docs/client/views/character/effects/effectView/effectView.js
index b803f8ad..e8b525f0 100644
--- a/rpg-docs/client/views/character/effects/effectView/effectView.js
+++ b/rpg-docs/client/views/character/effects/effectView/effectView.js
@@ -86,20 +86,20 @@ var operations = {
Template.effectView.helpers({
sourceName: function(){
- var id = this.sourceId;
+ var id = this.parent.id;
if(!id) return;
- switch(this.type){
- case "feature":
+ switch(this.parent.collection){
+ case "Features":
return "Feature - " + Features.findOne(id, {fields: {name: 1}}).name;
- case "class":
+ case "Classes":
return Classes.findOne(id, {fields: {name: 1}}).name;
- case "buff":
+ case "Buffs":
return "Buff - " + Buffs.findOne(id, {fields: {name: 1}}).name;
- case "equipment":
+ case "Items":
return "Equipment - " + Items.findOne(id, {fields: {name: 1}}).name;
- case "racial":
+ case "Characters":
return Characters.findOne(this.charId, {fields: {race: 1}}).race;
- case "inate":
+ default:
return "Inate"
}
},
diff --git a/rpg-docs/client/views/character/effects/effectsEditList/effectsEditList.html b/rpg-docs/client/views/character/effects/effectsEditList/effectsEditList.html
index 80b77f0e..b2ab66db 100644
--- a/rpg-docs/client/views/character/effects/effectsEditList/effectsEditList.html
+++ b/rpg-docs/client/views/character/effects/effectsEditList/effectsEditList.html
@@ -1,4 +1,4 @@
-
+
{{#if effects.count}}
diff --git a/rpg-docs/client/views/character/effects/effectsEditList/effectsEditList.js b/rpg-docs/client/views/character/effects/effectsEditList/effectsEditList.js
index 06c45b7f..a3e9ad39 100644
--- a/rpg-docs/client/views/character/effects/effectsEditList/effectsEditList.js
+++ b/rpg-docs/client/views/character/effects/effectsEditList/effectsEditList.js
@@ -1,6 +1,6 @@
Template.effectsEditList.helpers({
effects: function(){
- var cursor = Effects.find({sourceId: this.sourceId, type: this.type});
+ var cursor = Effects.find({"parent.id": this.parentId, "parent.collection": this.parentCollection, type: this.type});
return cursor;
}
});
@@ -13,7 +13,10 @@ Template.effectsEditList.events({
Effects.insert({
name: this.name,
charId: this.charId,
- sourceId: this.sourceId,
+ parent: {
+ id: this.parentId,
+ collection: this.parentCollection
+ },
operation: "add",
type: this.type,
enabled: this.enabled
diff --git a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.html b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.html
index 173e780c..8659bc8d 100644
--- a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.html
+++ b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.html
@@ -1,4 +1,4 @@
-
+
{{#if effects}}
diff --git a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js
index 92427188..7a9042c2 100644
--- a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js
+++ b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js
@@ -1,7 +1,7 @@
Template.effectsViewList.helpers({
effects: function(){
- if(this.sourceId){
- return Effects.find({sourceId: this.sourceId, type: this.type, charId: this.charId}, {fields: {sourceId: 0}});
+ if(this.parentId){
+ return Effects.find({"parent.id": this.parentId, type: this.type, charId: this.charId}, {fields: {parent: 0}});
} else if(this.stat){
return Effects.find({charId: this.charId, stat: this.stat});
}
diff --git a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html
index cf698f85..45a49e37 100644
--- a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html
+++ b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html
@@ -34,7 +34,7 @@
- {{> effectsEditList sourceId=_id charId=charId type="feature" name=name enabled=isEnabled}}
+ {{> effectsEditList parentId=_id parentCollection="Features" charId=charId type="feature" name=name enabled=isEnabled}}
{{/baseDialog}}
{{/with}}