| 
					
				 | 
			
			
				@@ -17,7 +17,7 @@ PostsListController = RouteController.extend({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   findOptions: function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      sort: { submitted: -1 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      sort: this.sort, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       limit: this.postsLimit() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -29,17 +29,34 @@ PostsListController = RouteController.extend({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data: function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var hasMore = this.posts().count() === this.postsLimit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    var nextPath = this.route.path({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      postsLimit: this.postsLimit() + this.increment 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       posts: this.posts(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       ready: this.postSub.ready, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      nextPath: hasMore ? nextPath : null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      nextPath: hasMore ? this.nextPath() : null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+NewPostsController = PostsListController.extend({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  sort: { submitted: -1, _id: -1 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  nextPath: function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return Router.routes.newPosts.path({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      postsLimit: this.postsLimit() + this.increment 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+BestPostsController = PostsListController.extend({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  sort: { votes: -1, submitted: -1, _id: -1 }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  nextPath: function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return Router.routes.bestPosts.path({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      postsLimit: this.postsLimit() + this.increment 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 Router.route('/posts/:_id', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   name: 'postPage', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   waitOn: function () { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -71,10 +88,14 @@ Router.route('/submit', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // C'est un nom de route, pas un nom de template. Mais IR le prend comme nom de 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // template par défaut. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-Router.route('/:postsLimit?', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  name: 'postsList' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+Router.route('/', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  name: 'home', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  controller: 'NewPostsController', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+Router.route('/new/:postsLimit?', { name: 'newPosts' }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+Router.route('/best/:postsLimit?', { name: 'bestPosts' }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 var requireLogin = function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (!Meteor.user()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (Meteor.loggingIn()) { 
			 |