2015-05-01 18:22:00 +02:00
|
|
|
var PostsDailyController = RouteController.extend({
|
2015-04-22 07:50:11 +09:00
|
|
|
|
|
|
|
onBeforeAction: function () {
|
|
|
|
this.render('postListTop', {to: 'postListTop'});
|
|
|
|
this.next();
|
|
|
|
},
|
|
|
|
|
|
|
|
template: function() {
|
|
|
|
// use a function to make sure the template is evaluated *after* any template overrides
|
|
|
|
return 'postsDaily';
|
|
|
|
},
|
|
|
|
|
|
|
|
subscriptions: function () {
|
|
|
|
// this.days = this.params.days ? this.params.days : daysPerPage;
|
|
|
|
// TODO: find a way to preload the first n posts of the first 5 days?
|
|
|
|
},
|
|
|
|
|
|
|
|
data: function () {
|
|
|
|
this.days = this.params.days ? this.params.days : daysPerPage;
|
|
|
|
Session.set('postsDays', this.days);
|
|
|
|
return {
|
|
|
|
days: this.days
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
getTitle: function () {
|
|
|
|
return i18n.t('daily');
|
|
|
|
},
|
|
|
|
|
|
|
|
getDescription: function () {
|
|
|
|
return i18n.t('day_by_day_view');
|
|
|
|
},
|
|
|
|
|
|
|
|
fastRender: true
|
|
|
|
});
|
|
|
|
|
|
|
|
Meteor.startup(function () {
|
|
|
|
|
|
|
|
Router.route('/daily/:days?', {
|
|
|
|
name: 'postsDaily',
|
|
|
|
controller: PostsDailyController
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|