travis-web/app/routes/repo/index.coffee
Piotr Sarnacki 47439657a1 Use lastBuild from defaultBranch on repository
One thing that is not standard here is a serializer for branch, which
uses @href as id. At this point branches don't have ids and ember-data
needs one, so using @href is the easiest way.
2015-12-08 10:18:02 +01:00

22 lines
543 B
CoffeeScript

`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
setupController: (controller, model) ->
@_super.apply this, arguments
@controllerFor('repo').activate('current')
renderTemplate: ->
if @modelFor('repo').get('defaultBranch.lastBuild')
@render 'build'
else
@render 'builds/not_found'
deactivate: ->
repo = @controllerFor('repo')
@controllerFor('build').set('build', null)
@controllerFor('job').set('job', null)
@_super.apply(this, arguments)
`export default Route`