var SiteRouter = Router.extend({ el: "body", routes: { "/": 'login', "/index/:keyword": 'index', "/index": 'index', "/login": 'login', "/signup": 'signup', "/details/:id": 'details', "/details/:id/settings": 'threadSettings', "/post": 'post', "/post/:keyword": 'post', "/search": 'search', "/mail": 'mailbox', "/mail/:mailbox": 'mailbox', "/mail/compose": 'compose', "/message/:id": 'message', "/comment/:id/edit": 'editComment', "/profile": 'profile', "/profile/:username": 'profile', }, initialize: function(){ }, index: function(keyword){ app.view = new IndexView () app.view.load(keyword) }, login: function(){ app.view = new LoginView () }, signup: function(){ app.view = new SignupView () }, details: function(id){ app.view = new DetailsView () app.view.load(id) }, threadSettings: function(id){ app.view = new DetailsView ({ settings: true }) app.view.load(id) }, editComment: function(id){ app.view = new EditCommentForm () app.view.load(id) }, mailbox: function(box){ app.view = new MailboxView () app.view.load(box) }, message: function(id){ app.view = new MessageView () app.view.load(id) }, post: function(keyword){ app.view = new ThreadForm () app.view.load(keyword || "") }, profile: function(username){ app.view = new ProfileView () app.view.load(username || auth.user.username) }, compose: function(){ app.view = new ComposeView () }, search: function(){ app.view = new SearchResults () app.view.load() }, })