Made proficiencies their own objects, added migration functionality
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<!--needs to be given charId, parentId and parentCollection-->
|
||||
<template name="proficiencyEditList">
|
||||
{{#if proficiencies.count}}
|
||||
<hr class="vertMargin">
|
||||
|
||||
<div id="proficiencies">
|
||||
<h2>Proficiencies</h2>
|
||||
{{#each proficiencies}}
|
||||
{{>proficiencyEdit}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<paper-button id="addProficiencyButton"
|
||||
class="red-button"
|
||||
raised>
|
||||
Add Proficiency
|
||||
</paper-button>
|
||||
</template>
|
||||
@@ -0,0 +1,24 @@
|
||||
Template.proficiencyEditList.helpers({
|
||||
proficiencies: function(){
|
||||
var cursor = Proficiencies.find({"parent.id": this.parentId, "parent.collection": this.parentCollection});
|
||||
return cursor;
|
||||
}
|
||||
});
|
||||
|
||||
Template.proficiencyEditList.events({
|
||||
"tap #addProficiencyButton": function(){
|
||||
if ( !_.isBoolean(this.enabled) ) {
|
||||
this.enabled = true;
|
||||
}
|
||||
Proficiencies.insert({
|
||||
charId: this.charId,
|
||||
parent: {
|
||||
id: this.parentId,
|
||||
collection: this.parentCollection
|
||||
},
|
||||
enabled: this.enabled,
|
||||
value: 1,
|
||||
type: "skill",
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user