diff --git a/app/controllers/repo.js b/app/controllers/repo.js index 2e03d10c..6208278b 100644 --- a/app/controllers/repo.js +++ b/app/controllers/repo.js @@ -27,6 +27,10 @@ export default Ember.Controller.extend({ return statusImage(this.get('repo.slug')); }.property('repo.slug'), + showCurrentBuild: function() { + return this.get('repo.lastBuildId') && this.get('repo.active'); + }.property('repo.lastBuildId', 'repo.active'), + actions: { statusImages() { this.get('popup').open('status-images'); diff --git a/app/routes/repo/index.js b/app/routes/repo/index.js index 2fc1fbd2..3ae29393 100644 --- a/app/routes/repo/index.js +++ b/app/routes/repo/index.js @@ -8,11 +8,7 @@ export default TravisRoute.extend({ }, renderTemplate() { - if (this.modelFor('repo').get('lastBuildId')) { - return this.render('build'); - } else { - return this.render('builds/not_found'); - } + return this.render('build'); }, deactivate() { var repo; diff --git a/app/templates/builds/not-found.hbs b/app/templates/builds/not-found.hbs deleted file mode 100644 index bd2b8add..00000000 --- a/app/templates/builds/not-found.hbs +++ /dev/null @@ -1 +0,0 @@ -{{no-builds}} \ No newline at end of file diff --git a/app/templates/repo.hbs b/app/templates/repo.hbs index f92280cc..4190b84a 100644 --- a/app/templates/repo.hbs +++ b/app/templates/repo.hbs @@ -23,13 +23,13 @@ {{repo-show-tabs repo=repo tab=tab build=build job=job}}
- {{#if repo.active}} + {{#if showCurrentBuild}} {{outlet}} {{else}} {{#if repo.lastBuildId}} - {{outlet}} - {{else}} {{not-active user=currentUser repo=repo}} + {{else}} + {{no-builds}} {{/if}} {{/if}}