[pro-merge] Update routes with changes from travis-pro
This commit is contained in:
parent
fde3af46f2
commit
e9cbd98713
|
@ -20,7 +20,20 @@ Travis.Route = Ember.Route.extend
|
||||||
signedIn: ->
|
signedIn: ->
|
||||||
@controllerFor('currentUser').get('content')
|
@controllerFor('currentUser').get('content')
|
||||||
|
|
||||||
|
needsAuth: (->
|
||||||
|
# on pro, we need to auth on every route
|
||||||
|
Travis.config.pro
|
||||||
|
).property()
|
||||||
|
|
||||||
Travis.ApplicationRoute = Travis.Route.extend
|
Travis.ApplicationRoute = Travis.Route.extend
|
||||||
|
needsAuth: false
|
||||||
|
|
||||||
|
renderTemplate: ->
|
||||||
|
if Travis.config.pro
|
||||||
|
$('body').addClass('pro')
|
||||||
|
|
||||||
|
@_super.apply(this, arguments)
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
redirectToGettingStarted: ->
|
redirectToGettingStarted: ->
|
||||||
# do nothing, we handle it only in index path
|
# do nothing, we handle it only in index path
|
||||||
|
@ -47,7 +60,10 @@ Travis.ApplicationRoute = Travis.Route.extend
|
||||||
@transitionTo('index')
|
@transitionTo('index')
|
||||||
|
|
||||||
afterSignOut: ->
|
afterSignOut: ->
|
||||||
@transitionTo('index')
|
if Travis.config.pro
|
||||||
|
@transitionTo('auth')
|
||||||
|
else
|
||||||
|
@transitionTo('index')
|
||||||
|
|
||||||
Travis.Router.map ->
|
Travis.Router.map ->
|
||||||
@resource 'index', path: '/', ->
|
@resource 'index', path: '/', ->
|
||||||
|
@ -342,6 +358,9 @@ Travis.IndexRoute = Travis.Route.extend
|
||||||
|
|
||||||
@render 'repos', outlet: 'left', into: 'index'
|
@render 'repos', outlet: 'left', into: 'index'
|
||||||
|
|
||||||
|
if Travis.config.pro
|
||||||
|
@render 'sidebar', outlet: 'right'
|
||||||
|
|
||||||
setupController: (controller)->
|
setupController: (controller)->
|
||||||
# TODO: this is redundant with my_repositories and recent routes
|
# TODO: this is redundant with my_repositories and recent routes
|
||||||
toActivate = if @signedIn() then 'owned' else 'recent'
|
toActivate = if @signedIn() then 'owned' else 'recent'
|
||||||
|
@ -410,6 +429,8 @@ Travis.ProfileInfoRoute = Travis.Route.extend
|
||||||
@render 'user'
|
@render 'user'
|
||||||
|
|
||||||
Travis.AuthRoute = Travis.Route.extend
|
Travis.AuthRoute = Travis.Route.extend
|
||||||
|
needsAuth: false
|
||||||
|
|
||||||
renderTemplate: ->
|
renderTemplate: ->
|
||||||
$('body').attr('id', 'auth')
|
$('body').attr('id', 'auth')
|
||||||
|
|
||||||
|
@ -423,6 +444,10 @@ Travis.AuthRoute = Travis.Route.extend
|
||||||
@transitionTo('index')
|
@transitionTo('index')
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
redirect: ->
|
||||||
|
if @signedIn()
|
||||||
|
@transitionTo('index')
|
||||||
|
|
||||||
Travis.SettingsRoute = Travis.Route.extend
|
Travis.SettingsRoute = Travis.Route.extend
|
||||||
needsAuth: true
|
needsAuth: true
|
||||||
setupController: (controller, model) ->
|
setupController: (controller, model) ->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user