diff --git a/client/helpers/router.js b/client/helpers/router.js index d940068e1..085233727 100644 --- a/client/helpers/router.js +++ b/client/helpers/router.js @@ -1,6 +1,7 @@ Router.configure({ layout: 'layout', - loadingTemplate: 'loading' + loadingTemplate: 'loading', + notFoundTemplate: 'not_found' }); Router.map(function() { @@ -12,6 +13,16 @@ Router.map(function() { this.route('posts_new', {path: '/new'}); this.route('posts_best', {path: '/best'}); this.route('posts_pending', {path: '/pending'}); + + this.route('post_digest', { + path: '/digest/:year/:month/:day', + waitOn: function() { + return Meteor.subscribe('postDigest', new Date(this.params.year, this.params.month-1, this.params.day)); + }, + data: function() { + return findDigestPosts(moment(new Date(this.params.year, this.params.month-1, this.params.day))); + } + }); this.route('post_page', { path: '/posts/:_id', diff --git a/client/main.js b/client/main.js index 2f11d40b8..9e09ef7df 100644 --- a/client/main.js +++ b/client/main.js @@ -32,16 +32,16 @@ if(Meteor.userId() != null){ // b) we know when an individual page is ready // Single Post -Meteor.autorun(function() { - Meteor.subscribe('singlePost', Session.get('selectedPostId'), function(){ - Session.set('singlePostReady', true); - }); -}); +// Meteor.autorun(function() { +// Meteor.subscribe('singlePost', Session.get('selectedPostId'), function(){ +// Session.set('singlePostReady', true); +// }); +// }); // Digest -Meteor.autorun(function() { - digestHandle = Meteor.subscribe('postDigest', Session.get('currentDate')); -}); +// Meteor.autorun(function() { +// digestHandle = Meteor.subscribe('postDigest', Session.get('currentDate')); +// }); // Posts Lists STATUS_PENDING=1; diff --git a/client/views/common/layout.js b/client/views/common/layout.js index aec999820..0c4a918a2 100644 --- a/client/views/common/layout.js +++ b/client/views/common/layout.js @@ -3,7 +3,8 @@ Template.layout.helpers({ if(Router._current){ var currentPath = Router._current.path; var currentRoute = _.findWhere(Router.routes, {originalPath: currentPath}); - return currentRoute.name; + if(currentRoute) + return currentRoute.name; } }, backgroundColor: function(){ diff --git a/client/views/posts/post_item.html b/client/views/posts/post_item.html index 346b41d0a..c80752563 100644 --- a/client/views/posts/post_item.html +++ b/client/views/posts/post_item.html @@ -38,9 +38,9 @@ {{name}} {{/each}} -