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

38 lines
812 B
JavaScript
Raw Normal View History

2014-12-08 11:15:20 +09:00
// Controller for post digest
2015-02-04 15:23:22 +09:00
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
2015-01-22 09:19:52 +09:00
Router.route('/day/:year/:month/:day', {
name: 'postsSingleDay',
2015-02-04 15:23:22 +09:00
controller: PostsSingledayController
2014-12-08 11:15:20 +09:00
});
2015-01-22 09:19:52 +09:00
Router.route('/day', {
name: 'postsSingleDayDefault',
2015-02-04 15:23:22 +09:00
controller: PostsSingledayController
2014-12-08 11:15:20 +09:00
});
});