Quick crude and hackish version of running jobs

This commit is contained in:
Piotr Sarnacki 2015-03-18 15:34:37 +01:00
parent 69d6f9e8a1
commit 55fd558eb0
4 changed files with 69 additions and 43 deletions

View File

@ -7,6 +7,13 @@ Controller = Ember.ArrayController.extend
activate: (name) ->
@activate(name)
showRunningJobs: ->
@activate('running')
showMyRepositories: ->
@activate('owned')
tabOrIsLoadedDidChange: (->
@possiblyRedirectToGettingStartedPage()
).observes('isLoaded', 'tab', 'length')
@ -57,6 +64,8 @@ Controller = Ember.ArrayController.extend
viewOwned: ->
@set('content', @get('userRepos'))
viewRunning: ->
userRepos: (->
if login = @get('currentUser.login')
Repo.accessibleBy(@store, login)
@ -91,4 +100,8 @@ Controller = Ember.ArrayController.extend
'Could not find any repos'
).property('tab')
showRunningJobs: (->
@get('tab') == 'running'
).property('tab')
`export default Controller`

View File

@ -4,7 +4,12 @@
{{view 'repos-list-tabs'}}
<div class="tab">
{{#if showRunningJobs}}
<div class="tab">
Running jobs will go here
</div>
{{else}}
<div class="tab">
{{#if isLoaded}}
{{#collection 'repos-list' content=this}}
{{#with view.repo as repo}}
@ -46,4 +51,5 @@
{{else}}
<span class="sync-spinner sync-spinner--grey"><i></i><i></i><i></i></span>
{{/if}}
</div>
</div>
{{/if}}

View File

@ -1,6 +1,6 @@
<ul class="tabs">
<li id="tab_owned" {{bind-attr class="view.classOwned"}}>
<h5>{{#link-to "main.repositories"}}My Repositories{{/link-to}}</h5>
<h5><a href="#" {{action "showMyRepositories"}}>My Repositories</a></h5>
</li>
{{#unless config.pro}}
@ -9,10 +9,11 @@
</li>
{{/unless}}
<li id="tab_search" {{bind-attr class="view.classSearch"}}>
<h5>Search</h5>
<li id="tab_running" {{bind-attr class="view.classRunning"}}>
<h5><a href="#" {{action "showRunningJobs"}}>Run</a></h5>
</li>
<li id="tab_new" {{bind-attr class="view.classNew"}}>
<h5>{{#link-to "profile" trackEvent="add-repository-from-list" title="Add New Repository"}}+{{/link-to}}</h5>
</li>

View File

@ -12,6 +12,12 @@ View = Ember.View.extend
'hidden'
).property('tab')
classRunning: (->
classes = []
classes.push('active') if @get('tab') == 'running'
classes.join(' ')
).property('tab')
classOwned: (->
classes = []
classes.push('active') if @get('tab') == 'owned'