Added Basic character list view
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Template.effectsEditList.helpers({
|
||||
effects: function(){
|
||||
var cursor = Effects.find({sourceId: this.sourceId});
|
||||
var cursor = Effects.find({sourceId: this.sourceId, type: this.type});
|
||||
return cursor;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
</template>
|
||||
|
||||
<template name="containerCardHelper">
|
||||
<paper-shadow class="card container" hero-id="main" {{detailHero}}>
|
||||
<div class="containerTop {{colorClass}}" hero-id="toolbar" layout horizontal center {{detailHero}}>
|
||||
<div class="containerName subhead" hero-id="title" flex {{detailHero}}>{{title}}</div>
|
||||
<paper-shadow class="card container {{class}}" hero-id="main" {{detailHero field}}>
|
||||
<div class="containerTop {{colorClass}}" hero-id="toolbar" layout horizontal center {{detailHero field}}>
|
||||
<div class="containerName subhead" hero-id="title" flex {{detailHero field}}>{{title}}</div>
|
||||
</div>
|
||||
<div flex class="containerMain">{{> UI.contentBlock}}</div>
|
||||
</paper-shadow>
|
||||
|
||||
@@ -11,7 +11,7 @@ var colorMap = {
|
||||
Template.persona.helpers({
|
||||
characterDetails: function(){
|
||||
var char = Characters.findOne(this._id, {fields: {name: 1, gender: 1, alignment: 1, race:1}})
|
||||
char._id += "details";
|
||||
char.field = "details";
|
||||
char.title = char.name;
|
||||
char.color = "d";
|
||||
return char;
|
||||
@@ -21,25 +21,25 @@ Template.persona.helpers({
|
||||
fieldSelector.fields[field] = 1;
|
||||
var char = Characters.findOne(this._id, fieldSelector);
|
||||
var color = colorMap[field];
|
||||
return {_id: char._id + field, title: title, field: field, color: color, body: char[field]};
|
||||
return {_id: char._id, title: title, field: field, color: color, body: char[field]};
|
||||
}
|
||||
});
|
||||
|
||||
Template.persona.events({
|
||||
"tap .containerTop": function(event){
|
||||
if(this.field){
|
||||
if(this.field !== "details"){
|
||||
var charId = Template.parentData()._id;
|
||||
GlobalUI.setDetail({
|
||||
template: "textDialog",
|
||||
data: {charId: charId, field: this.field, title: this.title, color: this.color},
|
||||
heroId: this._id
|
||||
heroId: this._id + this.field
|
||||
});
|
||||
} else{
|
||||
this.charId = Template.parentData()._id;
|
||||
GlobalUI.setDetail({
|
||||
template: "personaDetailsDialog",
|
||||
data: this,
|
||||
heroId: this._id
|
||||
heroId: this._id + "details"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,9 @@ Template.spells.helpers({
|
||||
}
|
||||
if(this.components.material){
|
||||
components += components? ", M" : "M";
|
||||
components += " ("+this.components.material+")";
|
||||
}
|
||||
if(this.components.concentration){
|
||||
components += " - Requires concentration"
|
||||
components += components? ", C" : "C";
|
||||
}
|
||||
return components;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user