travis-web/app/routes/job.coffee
Piotr Sarnacki dfc22014a8 Set page titles relevant to page is loaded
I used ember-cli-document-title addon.
2015-02-17 14:35:59 +01:00

33 lines
831 B
CoffeeScript

`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
titleToken: (model) ->
"Job ##{model.get('number')}"
serialize: (model, params) ->
id = if model.get then model.get('id') else model
{ job_id: id }
setupController: (controller, model) ->
if model && !model.get
model = @store.recordForId('job', model)
@store.find('job', model)
repo = @controllerFor('repo')
@controllerFor('job').set('job', model)
repo.activate('job')
if build = model.get('build')
build = @store.recordForId('build', build.get('id'))
@controllerFor('build').set('build', build)
model: (params) ->
@store.find('job', params.job_id)
deactivate: ->
@controllerFor('build').set('build', null)
@controllerFor('job').set('job', null)
`export default Route`