Added Basic character list view

This commit is contained in:
Thaum
2015-02-27 10:50:28 +00:00
parent 040d5a514b
commit b40094017f
10 changed files with 56 additions and 47 deletions

View File

@@ -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;
}
});

View File

@@ -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>

View File

@@ -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"
});
}
}

View File

@@ -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;
},