Began implementing features that change stats
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
Router.map( function () {
|
||||
this.route('home', {
|
||||
path: '/',
|
||||
data: { characters: function(){
|
||||
console.log('id ' + Meteor.userId());
|
||||
return Characters.find({owner: Meteor.userId()})
|
||||
}
|
||||
}
|
||||
this.route('home',
|
||||
{
|
||||
path: '/',
|
||||
data: {
|
||||
characters: function(){
|
||||
return Characters.find({owner: Meteor.userId()})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.route('character', {
|
||||
path: '/character/:_id',
|
||||
notFoundTemplate: 'characterNotFound',
|
||||
data: function() {
|
||||
character = Characters.findOne({_id: this.params._id});
|
||||
if (character) character.items = Items.find({owner: this.params._id});
|
||||
return character;
|
||||
}
|
||||
path: '/character/:_id',
|
||||
notFoundTemplate: 'characterNotFound',
|
||||
data: function() {
|
||||
var data = Characters.findOne({_id: this.params._id});
|
||||
data.features = Features.find({character: data._id});
|
||||
var newInstance = Object.create(protoCharacter);
|
||||
data = _.extend(newInstance, data);
|
||||
return data;
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user