Created
August 28, 2013 19:04
-
-
Save BenjaminRH/6369913 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.Router.add({ | |
'/': { | |
to: 'index', | |
and: function () { | |
Session.set('genre', null); | |
} | |
}, // site index | |
'/:action/:action2/:action3': function (action, action2, action3) { | |
var genreSession = null, | |
template = 'index'; | |
/** process all genres */ | |
if (_.contains(genresA, action)) { | |
genreSession = action; | |
template = 'list'; | |
} | |
if (action2 === 'battle' && !_.isEmpty(action3)) { | |
Session.set('currentBattleSlug', action3); | |
template = 'battle'; | |
} | |
/** end */ | |
//if (genreSession !== null) | |
Session.set('genre', genreSession); | |
/** return index page as default when 404 */ | |
return template; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment