Added a side list for characters
This commit is contained in:
25
rpg-docs/client/views/characterList/characterSideList.js
Normal file
25
rpg-docs/client/views/characterList/characterSideList.js
Normal file
@@ -0,0 +1,25 @@
|
||||
Template.characterSideList.onCreated(function() {
|
||||
this.subscribe("characterList");
|
||||
});
|
||||
|
||||
Template.characterSideList.helpers({
|
||||
characters: function() {
|
||||
var userId = Meteor.userId();
|
||||
return Characters.find(
|
||||
{
|
||||
$or: [
|
||||
{readers: userId},
|
||||
{writers: userId},
|
||||
{owner: userId},
|
||||
]
|
||||
},
|
||||
{fields: {name: 1}}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Template.characterSideList.events({
|
||||
"tap .singleLineItem": function(event, instance) {
|
||||
Router.go("characterSheet", {_id: this._id});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user