2014-12-08 11:15:20 +09:00
|
|
|
// Controller for post digest
|
|
|
|
|
2015-02-04 15:23:22 +09:00
|
|
|
PostsSingledayController = RouteController.extend({
|
2014-12-15 09:46:51 +09:00
|
|
|
|
2015-01-06 14:46:38 +09:00
|
|
|
template: getTemplate('singleDay'),
|
2014-12-15 09:46:51 +09:00
|
|
|
|
2015-03-22 09:42:58 +09:00
|
|
|
onBeforeAction: function () {
|
2015-03-22 11:19:27 +09:00
|
|
|
this.render(getTemplate('postListTop'), {to: 'postListTop'});
|
2015-03-22 09:42:58 +09:00
|
|
|
this.next();
|
|
|
|
},
|
|
|
|
|
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);
|
|
|
|
},
|
2014-12-15 09:46:51 +09:00
|
|
|
|
|
|
|
getTitle: function () {
|
2015-01-05 16:32:38 +09:00
|
|
|
return i18n.t('single_day') + ' - ' + getSetting('title', 'Telescope');
|
2014-12-15 09:46:51 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
getDescription: function () {
|
|
|
|
return i18n.t('posts_of_a_single_day');
|
|
|
|
},
|
|
|
|
|
2014-12-08 11:15:20 +09:00
|
|
|
fastRender: true
|
2014-12-15 09:46:51 +09:00
|
|
|
|
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', {
|
2015-01-08 16:01:51 +09:00
|
|
|
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', {
|
2015-01-08 16:01:51 +09:00
|
|
|
name: 'postsSingleDayDefault',
|
2015-02-04 15:23:22 +09:00
|
|
|
controller: PostsSingledayController
|
2014-12-08 11:15:20 +09:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|