This commit is contained in:
Sven Fuchs 2012-07-07 04:26:58 +02:00
parent b2874c4516
commit 37523b3c07
8 changed files with 78 additions and 92 deletions

View File

@ -12,14 +12,6 @@ Travis.reopen
repositoryBinding: 'parent.repository'
contentBinding: 'parent.builds'
BuildController: Em.Controller.extend
repositoryBinding: 'layout.repository'
buildBinding: 'layout.build'
JobController: Em.Controller.extend
repositoryBinding: 'layout.repository'
jobBinding: 'layout.job'
QueuesController: Em.ArrayController.extend()
UserController: Em.Controller.extend()
HooksController: Em.ArrayController.extend()

View File

@ -3,7 +3,7 @@ Travis.Controller = Em.Controller.extend
for name in Array.prototype.slice.apply(arguments)
name = "#{$.camelize(name, false)}Controller"
klass = Travis[$.camelize(name)] || Em.Controller
this[name] = klass.create(namespace: Travis, controllers: this)
this[name] = klass.create(parent: this, namespace: Travis, controllers: this)
connect: (parent) ->
parent.connectOutlet

View File

@ -6,34 +6,34 @@ Travis.RepositoryController = Travis.Controller.extend
activate: (action, params) ->
@_unbind()
@set('params', params)
this["view#{$.camelize(action)}"]()
@set('params', params)
viewIndex: ->
@connectTab('current')
@_bind('repository', 'controllers.repositoriesController.firstObject')
@_bind('build', 'repository.lastBuild')
@connectTab('current')
viewCurrent: ->
@connectTab('current')
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('build', 'repository.lastBuild')
@connectTab('current')
viewBuilds: ->
@connectTab('builds')
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('builds', 'repository.builds')
@connectTab('builds')
viewBuild: ->
@connectTab('build')
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('build', 'buildById')
@connectTab('build')
viewJob: ->
@connectTab('job')
@_bind('repository', 'repositoriesByParams.firstObject')
@_bind('build', 'job.build')
@_bind('job', 'jobById')
@connectTab('job')
repositoriesByParams: (->
Travis.Repository.bySlug("#{params.owner}/#{params.name}") if params = @get('params')
@ -50,7 +50,7 @@ Travis.RepositoryController = Travis.Controller.extend
connectTab: (tab) ->
@set('tab', tab)
name = if tab == 'current' then 'build' else tab
@connectOutlet(outletName: 'pane', name: name)
@connectOutlet(outletName: 'pane', controller: this, viewClass: Travis["#{$.camelize(name)}View"])
_bind: (to, from) ->
@bindings.push Ember.oneWay(this, to, from)

View File

@ -1,5 +1,4 @@
{{#if builds.isLoaded}}
{{#with view}}
<table id="builds" class="list">
<thead>
<tr>
@ -19,7 +18,7 @@
<td class="commit"><a {{bindAttr href="view.urlGithubCommit"}}>{{formatCommit commit}}</a></td>
<td class="message">{{{formatMessage commit.message short="true"}}}</td>
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</td>
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finishedAt}}</td>
</tr>
{{/view}}
{{/each}}
@ -31,7 +30,6 @@
{{t builds.show_more}}
</button>
</p>
{{/with}}
{{else}}
<div id="builds" class="loading">
<span>Loading</span>

View File

@ -9,7 +9,7 @@
commitBinding: 'build.commit'
color: (->
Travis.Helpers.colorForResult(@getPath('context.result'))
Travis.Helpers.colorForResult(@getPath('build.result'))
).property('build.result')
urlBuild: (->

View File

@ -11520,8 +11520,6 @@ Ember.ControllerMixin.reopen({
var viewClassName = name.charAt(0).toUpperCase() + name.substr(1) + "View";
viewClass = get(namespace, viewClassName);
controller = get(controllers, name + 'Controller');
Ember.assert("The name you supplied " + name + " did not resolve to a view " + viewClassName, !!viewClass);
Ember.assert("The name you supplied " + name + " did not resolve to a controller " + name + 'Controller', (!!controller && !!context) || !context);
}

File diff suppressed because one or more lines are too long

View File

@ -13474,8 +13474,6 @@ Ember.ControllerMixin.reopen({
var viewClassName = name.charAt(0).toUpperCase() + name.substr(1) + "View";
viewClass = get(namespace, viewClassName);
controller = get(controllers, name + 'Controller');
Ember.assert("The name you supplied " + name + " did not resolve to a view " + viewClassName, !!viewClass);
Ember.assert("The name you supplied " + name + " did not resolve to a controller " + name + 'Controller', (!!controller && !!context) || !context);
}