From 55fd558eb0386d75a9e9cd81e2b526df920e875d Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 18 Mar 2015 15:34:37 +0100 Subject: [PATCH 01/36] Quick crude and hackish version of running jobs --- app/controllers/repos.coffee | 13 +++++ app/templates/repos.hbs | 86 +++++++++++++++++-------------- app/templates/repos/list/tabs.hbs | 7 +-- app/views/repos-list-tabs.coffee | 6 +++ 4 files changed, 69 insertions(+), 43 deletions(-) diff --git a/app/controllers/repos.coffee b/app/controllers/repos.coffee index 5299869a..13264e08 100644 --- a/app/controllers/repos.coffee +++ b/app/controllers/repos.coffee @@ -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` diff --git a/app/templates/repos.hbs b/app/templates/repos.hbs index f23932e2..5250a70c 100644 --- a/app/templates/repos.hbs +++ b/app/templates/repos.hbs @@ -4,46 +4,52 @@ {{view 'repos-list-tabs'}} -
- {{#if isLoaded}} - {{#collection 'repos-list' content=this}} - {{#with view.repo as repo}} -
- - {{#if repo.slug}} - {{#link-to "repo" repo class="slug"}}{{repo.slug}}{{/link-to}} - {{/if}} -
- {{#with repo.lastBuildHash as lastBuild}} - {{#if repo.slug}} - {{#if lastBuild.id}} - {{#link-to "build" repo lastBuild.id - class="last_build"}}{{lastBuild.number}}{{/link-to}} - {{/if}} +{{#if showRunningJobs}} +
+ Running jobs will go here +
+{{else}} +
+ {{#if isLoaded}} + {{#collection 'repos-list' content=this}} + {{#with view.repo as repo}} +
+ + {{#if repo.slug}} + {{#link-to "repo" repo class="slug"}}{{repo.slug}}{{/link-to}} + {{/if}} +
+ {{#with repo.lastBuildHash as lastBuild}} + {{#if repo.slug}} + {{#if lastBuild.id}} + {{#link-to "build" repo lastBuild.id + class="last_build"}}{{lastBuild.number}}{{/link-to}} + {{/if}} + {{/if}} + {{/with}} + + {{#if repo.lastBuildHash.number }} +

+ Duration: + + {{format-duration repo.lastBuildDuration}} + +

+

+ Finished: + + {{format-time repo.lastBuildFinishedAt}} + +

{{/if}} + +
{{/with}} - - {{#if repo.lastBuildHash.number }} -

- Duration: - - {{format-duration repo.lastBuildDuration}} - -

-

- Finished: - - {{format-time repo.lastBuildFinishedAt}} - -

- {{/if}} - -
- {{/with}} + {{else}} +

{{noReposMessage}}

+ {{/collection}} {{else}} -

{{noReposMessage}}

- {{/collection}} - {{else}} - - {{/if}} -
+ + {{/if}} +
+{{/if}} diff --git a/app/templates/repos/list/tabs.hbs b/app/templates/repos/list/tabs.hbs index 3b45ab47..e389d287 100644 --- a/app/templates/repos/list/tabs.hbs +++ b/app/templates/repos/list/tabs.hbs @@ -1,6 +1,6 @@