Change CurrentUserController to Controller
This commit is contained in:
parent
394e9ce11b
commit
4201b81fe8
|
@ -3,7 +3,7 @@
|
||||||
Controller = Ember.Controller.extend
|
Controller = Ember.Controller.extend
|
||||||
allHooks: []
|
allHooks: []
|
||||||
needs: ['currentUser']
|
needs: ['currentUser']
|
||||||
userBinding: 'controllers.currentUser'
|
userBinding: 'controllers.currentUser.model'
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
@_super.apply this, arguments
|
@_super.apply this, arguments
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
`import GithubUrlPropertievs from 'travis/mixins/github-url-properties'`
|
`import GithubUrlPropertievs from 'travis/mixins/github-url-properties'`
|
||||||
|
|
||||||
Controller = Ember.Controller.extend GithubUrlPropertievs,
|
Controller = Ember.Controller.extend GithubUrlPropertievs,
|
||||||
needs: ['repo']
|
needs: ['repo', 'currentUser']
|
||||||
repoBinding: 'controllers.repo.repo'
|
repoBinding: 'controllers.repo.repo'
|
||||||
commitBinding: 'build.commit'
|
commitBinding: 'build.commit'
|
||||||
currentUserBinding: 'controllers.repo.currentUser'
|
currentUserBinding: 'controllers.currentUser.model'
|
||||||
tabBinding: 'controllers.repo.tab'
|
tabBinding: 'controllers.repo.tab'
|
||||||
sendFaviconStateChanges: true
|
sendFaviconStateChanges: true
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Controller = Ember.ObjectController.extend
|
Controller = Ember.Controller.extend
|
||||||
sync: ->
|
sync: ->
|
||||||
@get('model').sync()
|
@get('model').sync()
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Controller = Ember.Controller.extend
|
Controller = Ember.Controller.extend
|
||||||
needs: ['currentUser']
|
needs: ['currentUser']
|
||||||
user: Ember.computed.alias('controllers.currentUser')
|
user: Ember.computed.alias('controllers.currentUser.model')
|
||||||
|
|
||||||
isSyncing: Ember.computed.alias('user.isSyncing')
|
isSyncing: Ember.computed.alias('user.isSyncing')
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
Controller = Ember.ArrayController.extend
|
Controller = Ember.ArrayController.extend
|
||||||
needs: ['currentUser']
|
needs: ['currentUser']
|
||||||
currentUserBinding: 'controllers.currentUser'
|
currentUserBinding: 'controllers.currentUser.model'
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
@_super.apply this, arguments
|
@_super.apply this, arguments
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
`import { githubCommit } from 'travis/utils/urls'`
|
`import { githubCommit } from 'travis/utils/urls'`
|
||||||
|
|
||||||
Controller = Ember.Controller.extend
|
Controller = Ember.Controller.extend
|
||||||
needs: ['repo']
|
needs: ['repo', 'currentUser']
|
||||||
|
|
||||||
repoBinding: 'controllers.repo.repo'
|
repoBinding: 'controllers.repo.repo'
|
||||||
commitBinding: 'job.commit'
|
commitBinding: 'job.commit'
|
||||||
annotationsBinding: 'job.annotations'
|
annotationsBinding: 'job.annotations'
|
||||||
currentUserBinding: 'controllers.repo.currentUser'
|
currentUserBinding: 'controllers.currentUser.model'
|
||||||
tabBinding: 'controllers.repo.tab'
|
tabBinding: 'controllers.repo.tab'
|
||||||
|
|
||||||
currentItemBinding: 'job'
|
currentItemBinding: 'job'
|
||||||
|
|
|
@ -4,7 +4,7 @@ Controller = Ember.Controller.extend
|
||||||
name: 'profile'
|
name: 'profile'
|
||||||
|
|
||||||
needs: ['currentUser', 'accounts', 'account']
|
needs: ['currentUser', 'accounts', 'account']
|
||||||
userBinding: 'controllers.currentUser'
|
userBinding: 'controllers.currentUser.model'
|
||||||
accountBinding: 'controllers.account.model'
|
accountBinding: 'controllers.account.model'
|
||||||
|
|
||||||
activate: (action, params) ->
|
activate: (action, params) ->
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
Controller = Ember.Controller.extend
|
Controller = Ember.Controller.extend
|
||||||
needs: ['repos', 'currentUser', 'build', 'request', 'job']
|
needs: ['repos', 'currentUser', 'build', 'request', 'job']
|
||||||
currentUserBinding: 'controllers.currentUser'
|
currentUserBinding: 'controllers.currentUser.model'
|
||||||
|
|
||||||
build: Ember.computed.alias('controllers.build.build')
|
build: Ember.computed.alias('controllers.build.build')
|
||||||
job: Ember.computed.alias('controllers.job.job')
|
job: Ember.computed.alias('controllers.job.job')
|
||||||
|
|
|
@ -31,7 +31,7 @@ Controller = Ember.ArrayController.extend
|
||||||
|
|
||||||
isLoadedBinding: 'content.isLoaded'
|
isLoadedBinding: 'content.isLoaded'
|
||||||
needs: ['currentUser', 'repo', 'runningJobs', 'queue']
|
needs: ['currentUser', 'repo', 'runningJobs', 'queue']
|
||||||
currentUserBinding: 'controllers.currentUser'
|
currentUserBinding: 'controllers.currentUser.model'
|
||||||
selectedRepo: (->
|
selectedRepo: (->
|
||||||
# we need to observe also repo.content here, because we use
|
# we need to observe also repo.content here, because we use
|
||||||
# ObjectProxy in repo controller
|
# ObjectProxy in repo controller
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Controller = Ember.Controller.extend
|
Controller = Ember.Controller.extend
|
||||||
needs: ['currentUser']
|
needs: ['currentUser']
|
||||||
userBinding: 'controllers.currentUser'
|
userBinding: 'controllers.currentUser.model'
|
||||||
|
|
||||||
userName: (->
|
userName: (->
|
||||||
@get('user.name') || @get('user.login')
|
@get('user.name') || @get('user.login')
|
||||||
|
|
|
@ -5,7 +5,7 @@ Route = TravisRoute.extend
|
||||||
# TODO: setting accounts model in ProfileRoute is wrong, but
|
# TODO: setting accounts model in ProfileRoute is wrong, but
|
||||||
# at this stage it's better than what we had before
|
# at this stage it's better than what we had before
|
||||||
accounts = @modelFor('accounts')
|
accounts = @modelFor('accounts')
|
||||||
login = @controllerFor('currentUser').get('login')
|
login = @controllerFor('currentUser').get('model.login')
|
||||||
account = accounts.find (account) -> account.get('login') == login
|
account = accounts.find (account) -> account.get('login') == login
|
||||||
@replaceWith 'account', account
|
@replaceWith 'account', account
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<div class="tile-status">
|
<div class="tile-status">
|
||||||
<span {{bind-attr class=":icon :icon-status build.state"}}></span>
|
<span class="icon icon-status {{build.state}}"></span>
|
||||||
<span {{bind-attr class=":request-kind build.eventType :icon"}}></span>
|
<span class="request-kind icon {{build.eventType}}"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column tile-main medium-6">
|
<div class="column tile-main medium-6">
|
||||||
<h2>
|
<h2>
|
||||||
{{#if build.isPullRequest}}
|
{{#if build.isPullRequest}}
|
||||||
|
@ -16,7 +17,9 @@
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</h2>
|
</h2>
|
||||||
<p class="tile-author"><img {{bind-attr src="urlAuthorGravatarImage"}} alt="">{{build.commit.committerName}} committed</p>
|
<p class="tile-author"><img {{bind-attr src="urlAuthorGravatarImage"}} alt="">
|
||||||
|
{{build.commit.committerName}} committed
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="column tile-additional medium-6 end">
|
<div class="column tile-additional medium-6 end">
|
||||||
<div class="column small-6">
|
<div class="column small-6">
|
||||||
|
@ -35,6 +38,7 @@
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column small-6">
|
<div class="column small-6">
|
||||||
<p class="" {{bind-attr title="build.duration"}}>
|
<p class="" {{bind-attr title="build.duration"}}>
|
||||||
<span class="icon icon-clock"></span>
|
<span class="icon icon-clock"></span>
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dashboard">
|
<div class="dashboard">
|
||||||
|
|
||||||
<section class="dashboard-starred">
|
<section class="dashboard-starred">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="dashboard--empty">
|
<div class="dashboard--empty">
|
||||||
|
|
|
@ -23,7 +23,7 @@ githubAdmin = (slug) ->
|
||||||
|
|
||||||
statusImage = (slug, branch) ->
|
statusImage = (slug, branch) ->
|
||||||
if config.pro
|
if config.pro
|
||||||
token = Travis.__container__.lookup('controller:currentUser').get('token')
|
token = Travis.__container__.lookup('controller:currentUser').get('model.token')
|
||||||
"#{location.protocol}//#{location.host}/#{slug}.svg?token=#{token}" + if branch then "&branch=#{branch}" else ''
|
"#{location.protocol}//#{location.host}/#{slug}.svg?token=#{token}" + if branch then "&branch=#{branch}" else ''
|
||||||
else
|
else
|
||||||
"#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{encodeURIComponent(branch)}" else ''
|
"#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{encodeURIComponent(branch)}" else ''
|
||||||
|
@ -35,7 +35,7 @@ ccXml = (slug, branch) ->
|
||||||
|
|
||||||
if config.pro
|
if config.pro
|
||||||
delimiter = if url.indexOf('?') == -1 then '?' else '&'
|
delimiter = if url.indexOf('?') == -1 then '?' else '&'
|
||||||
token = Travis.__container__.lookup('controller:currentUser').get('token')
|
token = Travis.__container__.lookup('controller:currentUser').get('model.token')
|
||||||
url = "#{url}#{delimiter}token=#{token}"
|
url = "#{url}#{delimiter}token=#{token}"
|
||||||
|
|
||||||
url
|
url
|
||||||
|
|
|
@ -25,7 +25,7 @@ Log.Scroll.prototype = $.extend new Log.Listener,
|
||||||
|
|
||||||
View = BasicView.extend
|
View = BasicView.extend
|
||||||
templateName: 'jobs/pre'
|
templateName: 'jobs/pre'
|
||||||
currentUserBinding: 'controller.currentUser'
|
currentUserBinding: 'controller.currentUser.model'
|
||||||
|
|
||||||
logWillChange: (->
|
logWillChange: (->
|
||||||
console.log 'log view: log will change' if Log.DEBUG
|
console.log 'log view: log will change' if Log.DEBUG
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
View = Ember.View.extend
|
View = Ember.View.extend
|
||||||
templateName: 'repos/list/tabs'
|
templateName: 'repos/list/tabs'
|
||||||
tabBinding: 'controller.tab'
|
tabBinding: 'controller.tab'
|
||||||
currentUserBinding: 'controller.currentUser.id'
|
currentUserBinding: 'controller.currentUser.model'
|
||||||
|
|
||||||
classRecent: (->
|
classRecent: (->
|
||||||
if @get('tab') == 'recent'
|
if @get('tab') == 'recent'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user