Merge branch 'show-active-repos'
This commit is contained in:
commit
f089ee91a3
|
@ -48,6 +48,14 @@ Travis.FirstSyncController = Em.Controller.extend
|
||||||
|
|
||||||
isSyncing: Ember.computed.alias('user.isSyncing')
|
isSyncing: Ember.computed.alias('user.isSyncing')
|
||||||
|
|
||||||
|
Travis.BuildNotFoundController = Em.Controller.extend
|
||||||
|
needs: ['repo', 'currentUser']
|
||||||
|
ownedAndActive: (->
|
||||||
|
if permissions = @get('controllers.currentUser.permissions')
|
||||||
|
if repo = @get('controllers.repo.repo')
|
||||||
|
repo.get('active') && permissions.contains(parseInt(repo.get('id')))
|
||||||
|
).property('controllers.repo.repo', 'controllers.currentUser.permissions')
|
||||||
|
|
||||||
require 'controllers/accounts'
|
require 'controllers/accounts'
|
||||||
require 'controllers/build'
|
require 'controllers/build'
|
||||||
require 'controllers/builds'
|
require 'controllers/builds'
|
||||||
|
|
|
@ -12,6 +12,7 @@ require 'travis/model'
|
||||||
lastBuildFinishedAt: Ember.attr('string')
|
lastBuildFinishedAt: Ember.attr('string')
|
||||||
githubLanguage: Ember.attr('string')
|
githubLanguage: Ember.attr('string')
|
||||||
_lastBuildDuration: Ember.attr(Number, key: 'last_build_duration')
|
_lastBuildDuration: Ember.attr(Number, key: 'last_build_duration')
|
||||||
|
active: Ember.attr('boolean')
|
||||||
|
|
||||||
lastBuild: Ember.belongsTo('Travis.Build', key: 'last_build_id')
|
lastBuild: Ember.belongsTo('Travis.Build', key: 'last_build_id')
|
||||||
|
|
||||||
|
@ -113,7 +114,7 @@ require 'travis/model'
|
||||||
@find(owner_name: login, orderBy: 'name')
|
@find(owner_name: login, orderBy: 'name')
|
||||||
|
|
||||||
accessibleBy: (login) ->
|
accessibleBy: (login) ->
|
||||||
@find(member: login, orderBy: 'name')
|
@find(member: login, active: true)
|
||||||
|
|
||||||
search: (query) ->
|
search: (query) ->
|
||||||
@find(search: query, orderBy: 'name')
|
@find(search: query, orderBy: 'name')
|
||||||
|
|
|
@ -124,7 +124,8 @@ Travis.SetupLastBuild = Ember.Mixin.create
|
||||||
# TODO: it would be nicer to do it with promises
|
# TODO: it would be nicer to do it with promises
|
||||||
repo = @controllerFor('repo').get('repo')
|
repo = @controllerFor('repo').get('repo')
|
||||||
if repo && repo.get('isLoaded') && !repo.get('lastBuild')
|
if repo && repo.get('isLoaded') && !repo.get('lastBuild')
|
||||||
@render('builds/not_found', outlet: 'pane', into: 'repo')
|
Ember.run.next =>
|
||||||
|
@render('builds/not_found', outlet: 'pane', into: 'repo', controller: 'buildNotFound')
|
||||||
|
|
||||||
Travis.GettingStartedRoute = Ember.Route.extend
|
Travis.GettingStartedRoute = Ember.Route.extend
|
||||||
setupController: ->
|
setupController: ->
|
||||||
|
@ -281,7 +282,8 @@ Travis.RepoRoute = Ember.Route.extend
|
||||||
proxy.set 'isLoading', false
|
proxy.set 'isLoading', false
|
||||||
|
|
||||||
if repos.get('length') == 0
|
if repos.get('length') == 0
|
||||||
self.render('repos/not_found', outlet: 'main')
|
Ember.run.next ->
|
||||||
|
self.render('repos/not_found', outlet: 'main')
|
||||||
else
|
else
|
||||||
proxy.set 'content', repos.objectAt(0)
|
proxy.set 'content', repos.objectAt(0)
|
||||||
|
|
||||||
|
|
|
@ -1 +1,5 @@
|
||||||
There are no builds for this repository.
|
{{#if ownedAndActive}}
|
||||||
|
This repository is active, but there are no builds yet. Builds will appear here after you push new commits to the repository.
|
||||||
|
{{else}}
|
||||||
|
There are no builds for this repository.
|
||||||
|
{{/if}}
|
||||||
|
|
|
@ -14,11 +14,14 @@
|
||||||
{{#linkTo "repo" this class="slug"}}{{slug}}{{/linkTo}}
|
{{#linkTo "repo" this class="slug"}}{{slug}}{{/linkTo}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#with lastBuildHash}}
|
|
||||||
{{#if repo.slug}}
|
{{#if lastBuild}}
|
||||||
{{#linkTo "build" repo id class="last_build"}}{{number}}{{/linkTo}}
|
{{#with lastBuildHash}}
|
||||||
{{/if}}
|
{{#if repo.slug}}
|
||||||
{{/with}}
|
{{#linkTo "build" repo id class="last_build"}}{{number}}{{/linkTo}}
|
||||||
|
{{/if}}
|
||||||
|
{{/with}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<p class="summary">
|
<p class="summary">
|
||||||
<span class="duration-icon"></span><span class="duration_label">{{t repositories.duration}}:</span>
|
<span class="duration-icon"></span><span class="duration_label">{{t repositories.duration}}:</span>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user