Updated character lists to Polymer 1

This commit is contained in:
Stefan Zermatten
2017-01-16 13:48:18 +02:00
parent d9e180bac0
commit 01535a414c
12 changed files with 165 additions and 124 deletions

View File

@@ -1,20 +1,26 @@
Template.characterList.helpers({
characterDetails: function(){
var char = Characters.findOne(
this._id,
{fields: {name: 1, gender: 1, alignment: 1, race:1, color: 1}}
characters(){
var userId = Meteor.userId();
return Characters.find(
{
$or: [
{readers: userId},
{writers: userId},
{owner: userId},
]
},
{
fields: {name: 1, picture: 1, color: 1, race: 1, alignment: 1, gender: 1},
sort: {name: 1},
}
);
char.title = char.name;
char.field = "base";
char.class = "characterCard";
return char;
}
});
},
initials(name){
return name.replace(/[^A-Z]/g, "");
},
})
Template.characterList.events({
"tap .characterCard": function(event, instance){
Router.go("characterSheet", {_id: this._id});
},
"tap .addCharacter": function(event, template) {
GlobalUI.showDialog({
heading: "New Character",