port moar stuff
This commit is contained in:
parent
697676f6ff
commit
1825cc3ca4
|
@ -45,18 +45,20 @@ Travis.Router = Em.Router.extend
|
||||||
|
|
||||||
connectOutlets: (router, build) ->
|
connectOutlets: (router, build) ->
|
||||||
params = router.serializeObject(build)
|
params = router.serializeObject(build)
|
||||||
router.connectLayout params, (repository, build) ->
|
build = Travis.Build.find(params.id) unless build instanceof Travis.Build
|
||||||
|
router.connectLayout params, build, (repository, build) ->
|
||||||
router.connectBuild build
|
router.connectBuild build
|
||||||
|
|
||||||
job: Em.Route.extend
|
job: Em.Route.extend
|
||||||
route: '/:owner/:name/jobs/:id'
|
route: '/:owner/:name/jobs/:id'
|
||||||
serialize: (router, job) ->
|
serialize: (router, job) ->
|
||||||
console.log job
|
|
||||||
router.serializeObject job
|
router.serializeObject job
|
||||||
|
|
||||||
connectOutlets: (router, job) ->
|
connectOutlets: (router, job) ->
|
||||||
params = router.serializeObject(job)
|
params = router.serializeObject(job)
|
||||||
router.connectLayout params, (repository, job) ->
|
job = Travis.Job.find(params.id) unless build instanceof Travis.Job
|
||||||
|
build = job.get('build')
|
||||||
|
router.connectLayout params, build, job, (repository, job) ->
|
||||||
router.connectJob job
|
router.connectJob job
|
||||||
|
|
||||||
viewCurrent: Ember.Route.transitionTo('current')
|
viewCurrent: Ember.Route.transitionTo('current')
|
||||||
|
@ -79,12 +81,6 @@ Travis.Router = Em.Router.extend
|
||||||
else
|
else
|
||||||
object or {}
|
object or {}
|
||||||
|
|
||||||
connectLayout: (params, callback) ->
|
|
||||||
repositories = Travis.Repository.find()
|
|
||||||
@connectLeft repositories
|
|
||||||
@connectMain repositories, params, callback
|
|
||||||
@connectRight()
|
|
||||||
|
|
||||||
connectLeft: (repositories) ->
|
connectLeft: (repositories) ->
|
||||||
@get('applicationController').connectOutlet
|
@get('applicationController').connectOutlet
|
||||||
outletName: 'left'
|
outletName: 'left'
|
||||||
|
@ -99,17 +95,32 @@ Travis.Router = Em.Router.extend
|
||||||
outletName: 'main'
|
outletName: 'main'
|
||||||
name: 'loading'
|
name: 'loading'
|
||||||
|
|
||||||
connectMain: (repositories, params, callback) ->
|
connectLayout: (params, callback) ->
|
||||||
|
args = Array.prototype.slice.call(arguments, 1)
|
||||||
|
callback = args.pop()
|
||||||
|
build = args.shift()
|
||||||
|
job = args.shift()
|
||||||
|
|
||||||
|
repositories = Travis.Repository.find()
|
||||||
|
@connectLeft repositories
|
||||||
|
@connectMain repositories, params, build, job, callback
|
||||||
|
@connectRight()
|
||||||
|
|
||||||
|
connectMain: (repositories, params, build, job, callback) ->
|
||||||
@connectLoading()
|
@connectLoading()
|
||||||
if params.owner and params.name
|
if params.owner and params.name
|
||||||
|
# TODO this might be wrong for /:owner/:name ... when this repo is not contained
|
||||||
|
# in the current list of recent repositories
|
||||||
repositories = Travis.Repository.find().filter (data) ->
|
repositories = Travis.Repository.find().filter (data) ->
|
||||||
data.get('owner_name') is params.owner_name and data.get('name') is params.name
|
data.get('owner_name') is params.owner_name and data.get('name') is params.name
|
||||||
build = (if params.id then Travis.Build.find(params.id) else `undefined`)
|
|
||||||
|
build = job.get('build') if job && !build
|
||||||
|
# build = (if params.id then Travis.Build.find(params.id) else `undefined`)
|
||||||
|
|
||||||
onceLoaded repositories, build, =>
|
onceLoaded repositories, build, =>
|
||||||
repository = repositories.get('firstObject')
|
repository = repositories.get('firstObject')
|
||||||
@connectRepository repository
|
@connectRepository repository
|
||||||
@connectTabs repository, build
|
@connectTabs repository, build, job
|
||||||
callback repository, build
|
callback repository, build
|
||||||
|
|
||||||
connectRepository: (repository) ->
|
connectRepository: (repository) ->
|
||||||
|
@ -118,9 +129,11 @@ Travis.Router = Em.Router.extend
|
||||||
name: 'repository'
|
name: 'repository'
|
||||||
context: repository
|
context: repository
|
||||||
|
|
||||||
connectTabs: (repository, build) ->
|
connectTabs: (repository, build, job) ->
|
||||||
@setPath 'tabsController.repository', repository
|
@setPath 'tabsController.repository', repository
|
||||||
@setPath 'tabsController.build', build
|
@setPath 'tabsController.build', build
|
||||||
|
@setPath 'tabsController.job', job
|
||||||
|
|
||||||
@get('repositoryController').connectOutlet
|
@get('repositoryController').connectOutlet
|
||||||
outletName: 'tabs'
|
outletName: 'tabs'
|
||||||
name: 'tabs'
|
name: 'tabs'
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each requiredJobs}}
|
{{#each requiredJobs}}
|
||||||
<tr {{bindAttr class="color"}}>
|
<tr {{bindAttr class="color"}}>
|
||||||
<td class="number"><a {{action viewJob href=true context=this}}>{{number}}</a></td>
|
<td class="number"><a {{action viewJob href=true context=this}}>#{{number}}</a></td>
|
||||||
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</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 finished_at}}</td>
|
||||||
{{#each configValues}}
|
{{#each configValues}}
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each allowedFailureJobs}}
|
{{#each allowedFailureJobs}}
|
||||||
<tr {{bindAttr class="color"}}>
|
<tr {{bindAttr class="color"}}>
|
||||||
<td class="number"><a {{action viewJob href=true}}>{{number}}</a></td>
|
<td class="number"><a {{action viewJob href=true}}>#{{number}}</a></td>
|
||||||
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</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 finished_at}}</td>
|
||||||
{{#each configValues}}
|
{{#each configValues}}
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
<li><a {{action viewBuild href=true context="build"}} class="build">Build #{{build.number}}</a></li>
|
<li><a {{action viewBuild href=true context="build"}} class="build">Build #{{build.number}}</a></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if job}}
|
{{#if job}}
|
||||||
<li><a {{action viewJob href=true context="job"}} class="job">Job #{job.number}}</a></li>
|
<li><a {{action viewJob href=true context="job"}} class="job">Job #{{job.number}}</a></li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user