Skip to content

Commit

Permalink
Use dedicated route for profiles (user / organization).
Browse files Browse the repository at this point in the history
  • Loading branch information
michael committed Jul 2, 2012
1 parent 9139b1b commit 2f5be11
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion _includes/routers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
routers.Application = Backbone.Router.extend({
initialize: function() {
// Using this.route, because order matters
this.route(":user", 'user', this.start);
this.route(":user", 'user', this.profile);
this.route(/(.*\/.*)/, 'posts', this.posts);
this.route(/(.*\/.*)\/(.*\.\w+)$/, 'post', this.post);
this.route(/(.*\/.*)\/(.*\.\w+)(\/edit)$/, 'post', this.post);
Expand Down Expand Up @@ -37,6 +37,14 @@ routers.Application = Backbone.Router.extend({
return [url[0], app.state.repo, app.state.branch, app.state.path]
},

// #example-user
// #example-organization
profile: function(username) {
if (confirmExit()) {
app.instance.profile(username);
}
},

// #example-user/example-repo/gh-pages/path/to/new
newPost: function(url) {
if (confirmExit()) {
Expand Down

0 comments on commit 2f5be11

Please sign in to comment.