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

38 lines
818 B
JavaScript
Raw Normal View History

2014-12-08 11:15:20 +09:00
// Controller for post digest
PostsSingleDayController = RouteController.extend({
2015-01-06 14:46:38 +09:00
template: getTemplate('singleDay'),
2014-12-08 11:15:20 +09:00
data: function() {
2015-01-08 16:39:05 +09:00
var currentDate = this.params.day ? new Date(this.params.year, this.params.month-1, this.params.day) : Session.get('today');
2014-12-08 11:15:20 +09:00
Session.set('currentDate', currentDate);
},
getTitle: function () {
return i18n.t('single_day') + ' - ' + getSetting('title', 'Telescope');
},
getDescription: function () {
return i18n.t('posts_of_a_single_day');
},
2014-12-08 11:15:20 +09:00
fastRender: true
2014-12-08 11:15:20 +09:00
});
Meteor.startup(function () {
// Digest
Router.route('/digest/:year/:month/:day', {
name: 'postsSingleDay',
controller: PostsSingleDayController
2014-12-08 11:15:20 +09:00
});
Router.route('/digest', {
name: 'postsSingleDayDefault',
controller: PostsSingleDayController
2014-12-08 11:15:20 +09:00
});
});