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-04-22 07:50:11 +09:00
|
|
|
|
2015-05-07 15:44:12 +09:00
|
|
|
view: "daily",
|
2015-04-22 07:50:11 +09:00
|
|
|
|
|
|
|
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?
|
2015-05-19 18:29:54 +09:00
|
|
|
return 'posts_daily';
|
2015-04-22 07:50:11 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
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
|
|
|
}
|
2015-04-22 07:50:11 +09:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
Meteor.startup(function () {
|
|
|
|
|
|
|
|
Router.route('/daily/:days?', {
|
|
|
|
name: 'postsDaily',
|
2015-05-18 10:00:41 +09:00
|
|
|
template: 'posts_daily',
|
2015-05-07 15:44:12 +09:00
|
|
|
controller: Posts.controllers.daily
|
2015-04-22 07:50:11 +09:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|