Removed unneeded "type" from schemas, use parent.collection instead.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!--needs to be given charId, parentId and type-->
|
||||
<!--needs to be given charId, parentId and parentCollection-->
|
||||
<template name="attackEditList">
|
||||
{{#if attacks.count}}
|
||||
<hr style="margin: 16px 0 16px 0;">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Template.attackEditList.helpers({
|
||||
attacks: function(){
|
||||
var cursor = Attacks.find({"parent.id": this.parentId, type: this.type, charId: this.charId});
|
||||
var cursor = Attacks.find({"parent.id": this.parentId, charId: this.charId});
|
||||
return cursor;
|
||||
}
|
||||
});
|
||||
@@ -12,8 +12,7 @@ Template.attackEditList.events({
|
||||
parent: {
|
||||
id: this.parentId,
|
||||
collection: this.parentCollection
|
||||
},
|
||||
type: this.type,
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--needs to be given charId, parentId, parentCollection and type-->
|
||||
<!--needs to be given charId, parentId and parentCollection-->
|
||||
<template name="effectsEditList">
|
||||
{{#if effects.count}}
|
||||
<hr style="margin: 16px 0 16px 0;">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Template.effectsEditList.helpers({
|
||||
effects: function(){
|
||||
var cursor = Effects.find({"parent.id": this.parentId, "parent.collection": this.parentCollection, type: this.type});
|
||||
var cursor = Effects.find({"parent.id": this.parentId, "parent.collection": this.parentCollection});
|
||||
return cursor;
|
||||
}
|
||||
});
|
||||
@@ -18,7 +18,6 @@ Template.effectsEditList.events({
|
||||
collection: this.parentCollection
|
||||
},
|
||||
operation: "add",
|
||||
type: this.type,
|
||||
enabled: this.enabled
|
||||
});
|
||||
},
|
||||
|
||||
@@ -81,5 +81,5 @@
|
||||
</paper-autogrow-textarea>
|
||||
</paper-input-decorator>
|
||||
|
||||
{{> effectsEditList parentId=_id parentCollection="Features" charId=charId type="feature" name=name enabled=enabled}}
|
||||
{{> effectsEditList parentId=_id parentCollection="Features" charId=charId name=name enabled=enabled}}
|
||||
</template>
|
||||
|
||||
@@ -80,9 +80,9 @@
|
||||
</paper-autogrow-textarea>
|
||||
</paper-input-decorator>
|
||||
<!--Effects-->
|
||||
{{> effectsEditList parentId=_id parentCollection="Items" charId=charId type="equipment" enabled=equipped name=name}}
|
||||
{{> effectsEditList parentId=_id parentCollection="Items" charId=charId enabled=equipped name=name}}
|
||||
<!--Attacks-->
|
||||
{{> attackEditList parentId=_id parentCollection="Items" charId=charId type="equipment" enabled=equipped name=name}}
|
||||
{{> attackEditList parentId=_id parentCollection="Items" charId=charId enabled=equipped name=name}}
|
||||
</template>
|
||||
|
||||
<template name="containerDropdown">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!--Level-->
|
||||
<paper-input id="levelValueInput" label="Level" floatinglabel value={{level}}></paper-input>
|
||||
<!--Effects-->
|
||||
{{> effectsEditList parentId=_id parentCollection="Classes" charId=charId type="class"}}
|
||||
{{> effectsEditList parentId=_id parentCollection="Classes" charId=charId}}
|
||||
{{/baseDialog}}
|
||||
{{/with}}
|
||||
</template>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template name="raceDialog">
|
||||
{{#baseDialog title="Race" class=colorClass hideColor="true" hideDelete="true"}}
|
||||
<paper-input id="raceInput" label="Race" floatinglabel value={{race}}></paper-input>
|
||||
{{> effectsEditList parentId=charId parentCollection="Characters" charId=charId type="racial"}}
|
||||
{{> effectsEditList parentId=charId parentCollection="Characters" charId=charId}}
|
||||
{{/baseDialog}}
|
||||
</template>
|
||||
@@ -152,27 +152,14 @@ Template.skillDialog.helpers({
|
||||
return Characters.findOne(this.charId, {fields:{_id: 1}});
|
||||
},
|
||||
sourceName: function(){
|
||||
var id = this.parent.id;
|
||||
if(!id) return;
|
||||
switch(this.type){
|
||||
case "feature":
|
||||
return Features.findOne(id, {fields: {name: 1}}).name;
|
||||
case "class":
|
||||
return Classes.findOne(id, {fields: {name: 1}}).name;
|
||||
case "buff":
|
||||
return Buffs.findOne(id, {fields: {name: 1}}).name;
|
||||
case "equipment":
|
||||
return Items.findOne(id, {fields: {name: 1}}).name;
|
||||
case "racial":
|
||||
return Characters.findOne(this.charId, {fields: {race: 1}}).race;
|
||||
case "inate":
|
||||
return "Inate"
|
||||
}
|
||||
if (this.parent.collection === "Characters") return "inate";
|
||||
var parent = this.getParent();
|
||||
return parent && parent.name;
|
||||
},
|
||||
operationName: function(){
|
||||
if(this.operation === "proficiency") return null;
|
||||
if(stats[this.stat].group === "Weakness/Resistance") return null;
|
||||
return operations[this.operation] && operations[this.operation].name || "No Operation"
|
||||
return operations[this.operation] && operations[this.operation].name || "No Operation";
|
||||
},
|
||||
statValue: function(){
|
||||
if(this.operation === "advantage" ||
|
||||
|
||||
Reference in New Issue
Block a user