|  | @@ -4,18 +4,11 @@ Router.configure({
 | 
	
		
			
				|  |  |    notFoundTemplate: 'notFound',
 | 
	
		
			
				|  |  |    waitOn: function () {
 | 
	
		
			
				|  |  |      return [
 | 
	
		
			
				|  |  | -      Meteor.subscribe('posts'),
 | 
	
		
			
				|  |  |        Meteor.subscribe('notifications')
 | 
	
		
			
				|  |  |      ];
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -// C'est un nom de route, pas un nom de template. Mais IR le prend comme nom de
 | 
	
		
			
				|  |  | -// template par défaut.
 | 
	
		
			
				|  |  | -Router.route('/', {
 | 
	
		
			
				|  |  | -  name: 'postsList'
 | 
	
		
			
				|  |  | -});
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  Router.route('/posts/:_id', {
 | 
	
		
			
				|  |  |    name: 'postPage',
 | 
	
		
			
				|  |  |    waitOn: function () {
 | 
	
	
		
			
				|  | @@ -29,6 +22,9 @@ Router.route('/posts/:_id', {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  Router.route('/posts/:_id/edit', {
 | 
	
		
			
				|  |  |    name: 'postEdit',
 | 
	
		
			
				|  |  | +  waitOn: function () {
 | 
	
		
			
				|  |  | +    return Meteor.subscribe('singlePost', this.params._id);
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  |    data: function () {
 | 
	
		
			
				|  |  |      // "this" is the matched route.
 | 
	
		
			
				|  |  |      return Posts.findOne(this.params._id);
 | 
	
	
		
			
				|  | @@ -39,6 +35,29 @@ Router.route('/submit', {
 | 
	
		
			
				|  |  |    name: 'postSubmit'
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +// C'est un nom de route, pas un nom de template. Mais IR le prend comme nom de
 | 
	
		
			
				|  |  | +// template par défaut.
 | 
	
		
			
				|  |  | +Router.route('/:postLimit?', {
 | 
	
		
			
				|  |  | +  name: 'postsList',
 | 
	
		
			
				|  |  | +  waitOn: function () {
 | 
	
		
			
				|  |  | +    var limit = parseInt(this.params.postLimit) || 5;
 | 
	
		
			
				|  |  | +    return Meteor.subscribe('posts', {
 | 
	
		
			
				|  |  | +      sort: { submitted: -1 },
 | 
	
		
			
				|  |  | +      limit: limit
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  data: function () {
 | 
	
		
			
				|  |  | +    var limit = parseInt(this.params.postLimit) || 5;
 | 
	
		
			
				|  |  | +    return {
 | 
	
		
			
				|  |  | +      posts: Posts.find({}, {
 | 
	
		
			
				|  |  | +        sort: { submitted: -1 },
 | 
	
		
			
				|  |  | +        limit: limit
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  var requireLogin = function () {
 | 
	
		
			
				|  |  |    if (!Meteor.user()) {
 | 
	
		
			
				|  |  |      if (Meteor.loggingIn()) {
 |