Merge branch 'running-jobs-in-left-sidebar' into to-the-left
This commit is contained in:
commit
3291355808
|
@ -7,6 +7,13 @@ Controller = Ember.ArrayController.extend
|
||||||
activate: (name) ->
|
activate: (name) ->
|
||||||
@activate(name)
|
@activate(name)
|
||||||
|
|
||||||
|
showRunningJobs: ->
|
||||||
|
@activate('running')
|
||||||
|
|
||||||
|
showMyRepositories: ->
|
||||||
|
@activate('owned')
|
||||||
|
|
||||||
|
|
||||||
tabOrIsLoadedDidChange: (->
|
tabOrIsLoadedDidChange: (->
|
||||||
@possiblyRedirectToGettingStartedPage()
|
@possiblyRedirectToGettingStartedPage()
|
||||||
).observes('isLoaded', 'tab', 'length')
|
).observes('isLoaded', 'tab', 'length')
|
||||||
|
@ -57,6 +64,8 @@ Controller = Ember.ArrayController.extend
|
||||||
viewOwned: ->
|
viewOwned: ->
|
||||||
@set('content', @get('userRepos'))
|
@set('content', @get('userRepos'))
|
||||||
|
|
||||||
|
viewRunning: ->
|
||||||
|
|
||||||
userRepos: (->
|
userRepos: (->
|
||||||
if login = @get('currentUser.login')
|
if login = @get('currentUser.login')
|
||||||
Repo.accessibleBy(@store, login)
|
Repo.accessibleBy(@store, login)
|
||||||
|
@ -91,4 +100,8 @@ Controller = Ember.ArrayController.extend
|
||||||
'Could not find any repos'
|
'Could not find any repos'
|
||||||
).property('tab')
|
).property('tab')
|
||||||
|
|
||||||
|
showRunningJobs: (->
|
||||||
|
@get('tab') == 'running'
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
`export default Controller`
|
`export default Controller`
|
||||||
|
|
|
@ -6,52 +6,63 @@
|
||||||
|
|
||||||
{{view 'repos-list-tabs'}}
|
{{view 'repos-list-tabs'}}
|
||||||
|
|
||||||
<div class="tabbody sidebar-list">
|
{{#if showRunningJobs}}
|
||||||
|
<div class="tabbody sidebar-list">
|
||||||
|
{{render "runningJobs"}}
|
||||||
|
|
||||||
{{#if isLoaded}}
|
{{render "queue"}}
|
||||||
{{#collection 'repos-list' content=this}}
|
</div>
|
||||||
{{#with view.repo as repo}}
|
{{else}}
|
||||||
<div {{bind-attr class=":tile :tile--sidebar repo.lastBuildState"}}>
|
<div class="tabbody sidebar-list">
|
||||||
<h2 class="tile-title">
|
{{#if isLoaded}}
|
||||||
{{#if repo.slug}}
|
{{#collection 'repos-list' content=this}}
|
||||||
<span {{bind-attr class=":icon :icon--job repo.lastBuildState"}}></span>
|
{{#with view.repo as repo}}
|
||||||
{{#link-to "repo" repo class="slug"}}{{repo.slug}}{{/link-to}}
|
<div {{bind-attr class=":tile :tile--sidebar repo.lastBuildState"}}>
|
||||||
{{/if}}
|
<h2 class="tile-title">
|
||||||
</h2>
|
{{#if repo.slug}}
|
||||||
{{#with repo.lastBuildHash as lastBuild}}
|
<span {{bind-attr class=":icon :icon--job repo.lastBuildState"}}></span>
|
||||||
{{#if repo.slug}}
|
{{#link-to "repo" repo class="slug"}}{{repo.slug}}{{/link-to}}
|
||||||
{{#if lastBuild.id}}
|
|
||||||
<p class="tile-title float-right">
|
|
||||||
<span class="icon icon--hash"></span>
|
|
||||||
{{#link-to "build" repo lastBuild.id
|
|
||||||
class="last_build"}}{{lastBuild.number}}{{/link-to}}
|
|
||||||
</p>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
</h2>
|
||||||
{{/with}}
|
{{#with repo.lastBuildHash as lastBuild}}
|
||||||
<p>
|
{{#if repo.slug}}
|
||||||
<span class="icon icon--clock"></span>
|
{{#if lastBuild.id}}
|
||||||
Duration:
|
<p class="tile-title float-right">
|
||||||
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>
|
<span class="icon icon--hash"></span>
|
||||||
{{format-duration repo.lastBuildDuration}}
|
{{#link-to "build" repo lastBuild.id
|
||||||
</abbr>
|
class="last_build"}}{{lastBuild.number}}{{/link-to}}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
{{/if}}
|
||||||
<span class="icon icon--cal"></span>
|
{{/if}}
|
||||||
Finished:
|
{{/with}}
|
||||||
<abbr clas s="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>
|
|
||||||
{{format-time repo.lastBuildFinishedAt}}
|
{{#if repo.lastBuildHash.number }}
|
||||||
</abbr>
|
<p>
|
||||||
</p>
|
<span class="icon icon--clock"></span>
|
||||||
</div>
|
Duration:
|
||||||
{{/with}}
|
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>
|
||||||
{{else}}
|
{{format-duration repo.lastBuildDuration}}
|
||||||
<p class="empty">{{noReposMessage}}</p>
|
</abbr>
|
||||||
{{/collection}}
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<span class="icon icon--cal"></span>
|
||||||
|
Finished:
|
||||||
|
<abbr class="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>
|
||||||
|
{{format-time repo.lastBuildFinishedAt}}
|
||||||
|
</abbr>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{{/with}}
|
||||||
|
{{else}}
|
||||||
|
<p class="empty">{{noReposMessage}}</p>
|
||||||
|
{{/collection}}
|
||||||
|
|
||||||
|
{{else}}
|
||||||
|
<div class="spinner-container">
|
||||||
|
<span class="sync-spinner sync-spinner--grey"><i></i><i></i><i></i></span>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{else}}
|
|
||||||
<div class="spinner-container">
|
|
||||||
<span class="sync-spinner sync-spinner--grey"><i></i><i></i><i></i></span>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
|
@ -1,19 +1,19 @@
|
||||||
<div class="tabnav tabnav--sidebar" role="tablist">
|
<div class="tabnav tabnav--sidebar" role="tablist">
|
||||||
<ul class="tab tabs--sidebar">
|
<ul class="tab tabs--sidebar">
|
||||||
<li id="tab_owned" {{bind-attr class="view.classOwned"}}>
|
<li id="tab_owned" {{bind-attr class="view.classOwned"}}>
|
||||||
{{#link-to "main.repositories"}}My Repositories{{/link-to}}
|
<a href="#" {{action "showMyRepositories"}}>My Repositories</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{#unless config.pro}}
|
{{#unless config.pro}}
|
||||||
<li id="tab_recent" {{bind-attr class="view.classRecent"}}>
|
{{!-- <li id="tab_recent" {{bind-attr class="view.classRecent"}}>
|
||||||
{{#link-to "main.recent"}}Recent{{/link-to}}
|
{{#link-to "main.recent"}}Recent{{/link-to}}
|
||||||
|
</li> --}}
|
||||||
|
|
||||||
|
<li id="tab_running" {{bind-attr class="view.classRunning"}}>
|
||||||
|
<a href="#" {{action "showRunningJobs"}}>Running</a>
|
||||||
</li>
|
</li>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
{{!-- <li id="tab_search" {{bind-attr class="view.classSearch"}}>
|
|
||||||
<h5>Search</h5>
|
|
||||||
</li> --}}
|
|
||||||
|
|
||||||
<li id="tab_new" {{bind-attr class="view.classNew :float-right"}}>
|
<li id="tab_new" {{bind-attr class="view.classNew :float-right"}}>
|
||||||
{{#link-to "profile" trackEvent="add-repository-from-list" title="Add New Repository"}}
|
{{#link-to "profile" trackEvent="add-repository-from-list" title="Add New Repository"}}
|
||||||
<span class="icon icon--plus"></span>
|
<span class="icon icon--plus"></span>
|
||||||
|
|
|
@ -12,6 +12,12 @@ View = Ember.View.extend
|
||||||
'hidden'
|
'hidden'
|
||||||
).property('tab')
|
).property('tab')
|
||||||
|
|
||||||
|
classRunning: (->
|
||||||
|
classes = []
|
||||||
|
classes.push('active') if @get('tab') == 'running'
|
||||||
|
classes.join(' ')
|
||||||
|
).property('tab')
|
||||||
|
|
||||||
classOwned: (->
|
classOwned: (->
|
||||||
classes = []
|
classes = []
|
||||||
classes.push('active') if @get('tab') == 'owned'
|
classes.push('active') if @get('tab') == 'owned'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user