Vulcan/packages/telescope-daily/lib/routes.js

32 lines
610 B
JavaScript
Raw Normal View History

2015-05-10 13:37:42 +09:00
/**
* Controller for daily view
*/
2015-05-07 15:44:12 +09:00
Posts.controllers.daily = Posts.controllers.list.extend({
2015-05-07 15:44:12 +09:00
view: "daily",
template: function() {
// use a function to make sure the template is evaluated *after* any template overrides
2015-05-07 15:44:12 +09:00
// TODO: still needed?
return 'postsDaily';
},
data: function () {
this.days = this.params.days ? this.params.days : daysPerPage;
Session.set('postsDays', this.days);
return {
days: this.days
};
2015-05-07 15:44:12 +09:00
}
});
Meteor.startup(function () {
Router.route('/daily/:days?', {
name: 'postsDaily',
2015-05-07 15:44:12 +09:00
controller: Posts.controllers.daily
});
});