Fix profile info tab

This commit is contained in:
Piotr Sarnacki 2015-01-06 12:45:08 +01:00
parent e95e679e80
commit 0074acb8fe
4 changed files with 12 additions and 6 deletions

View File

@ -30,7 +30,7 @@ Travis.StatsLayoutController = Em.Controller.extend()
Travis.ProfileLayoutController = Em.Controller.extend()
Travis.AuthLayoutController = Em.Controller.extend()
Travis.ProfileInfoController = Em.Controller.extend
Travis.AccountsInfoController = Em.Controller.extend
needs: ['currentUser', 'repos']
userBinding: 'controllers.currentUser'

View File

@ -16,7 +16,11 @@ Travis.ProfileController = Travis.Controller.extend
@connectTab('user')
connectTab: (tab) ->
viewClass = Travis["#{$.camelize(tab)}View"]
if tab == 'user'
view = 'AccountsInfoView'
else
view = "#{$.camelize(tab)}View"
viewClass = Travis[view]
@set('tab', tab)
billingUrl: (->

View File

@ -429,12 +429,14 @@ Travis.AccountRoute = Travis.Route.extend
else
{}
Travis.ProfileInfoRoute = Travis.Route.extend
Travis.AccountsInfoRoute = Travis.Route.extend
setupController: ->
@container.lookup('controller:profile').activate 'user'
user = @controllerFor('currentUser').get('model')
@controllerFor('account').set('model', user)
@controllerFor('profile').activate 'user'
renderTemplate: ->
@render 'user'
@render 'accounts_info'
Travis.AuthRoute = Travis.Route.extend
needsAuth: false

View File

@ -38,7 +38,7 @@ Travis.reopen
Travis.Urls.githubAdmin(@get('hook.slug'))
).property('hook.slug')
UserView: Travis.View.extend
AccountsInfoView: Travis.View.extend
templateName: 'profile/tabs/user'
userBinding: 'controller.user'