From 75ce90fc03754cb1bb96852c7ccf13b8cbc2dbc8 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 14 Aug 2015 16:58:06 +0200 Subject: [PATCH 1/2] check for lastBuildId and only display not-active if it is false --- app/controllers/builds.coffee | 10 ++++++++ app/styles/app/layouts/missing-notice.sass | 7 +++++- app/templates/builds.hbs | 2 +- app/templates/components/no-builds.hbs | 27 ++++++++++++---------- app/templates/components/not-active.hbs | 2 +- app/templates/repo.hbs | 6 ++++- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/app/controllers/builds.coffee b/app/controllers/builds.coffee index 582307ad..681799df 100644 --- a/app/controllers/builds.coffee +++ b/app/controllers/builds.coffee @@ -31,6 +31,16 @@ Controller = Ember.ArrayController.extend false ).property('tab', 'repo.builds', 'repo.pullRequests') + displayBranches: (-> + if @get('tab') == 'branches' + if Ember.isEmpty(@get('repo.branches.content.content')) + true + else + false + else + false + ).property('tab', 'repo.builds', 'repo.branches') + things: (-> return { repo: @get('repo'), diff --git a/app/styles/app/layouts/missing-notice.sass b/app/styles/app/layouts/missing-notice.sass index d2ec8ed8..a88d555f 100644 --- a/app/styles/app/layouts/missing-notice.sass +++ b/app/styles/app/layouts/missing-notice.sass @@ -1,9 +1,14 @@ .missing-notice text-align: center - a + p a + color: $grey-dark + text-decoration: underline + + a.button font-size: 14px + .page-title color: #434343 font-size: 36px diff --git a/app/templates/builds.hbs b/app/templates/builds.hbs index be1ab124..c44c859e 100644 --- a/app/templates/builds.hbs +++ b/app/templates/builds.hbs @@ -3,7 +3,7 @@ {{#each controller as |build|}} {{builds-item build=build}} {{else}} - {{no-builds repo=things isPR=displayPullRequests}} + {{no-builds repo=things isPR=displayPullRequests isBranch=displayBranches}} {{/each}} {{#if displayShowMoreButton}}

diff --git a/app/templates/components/no-builds.hbs b/app/templates/components/no-builds.hbs index 2d5f5168..e7ca6d7c 100644 --- a/app/templates/components/no-builds.hbs +++ b/app/templates/components/no-builds.hbs @@ -62,17 +62,20 @@ - {{#unless isPR}} -

No builds for this repository

-

Want to start testing this project on Travis CI?

- Read the Docs on Getting Started - {{!-- {{#if isLoading}} - {{loading-indicator}} - {{else}} - Trigger the first build - {{/if}} --}} + {{#if isPR}} +

No pull request builds for this repositiory

{{else}} -

No Pull Request builds for this repositiory

- {{/unless}} - + {{#if isBranch}} +

No other branches for this repositiory

+ {{else}} +

No builds for this repository

+

Want to start testing this project on Travis CI?

+ Read the Docs on Getting Started + {{!-- {{#if isLoading}} + {{loading-indicator}} + {{else}} + Trigger the first build + {{/if}} --}} + {{/if}} + {{/if}} diff --git a/app/templates/components/not-active.hbs b/app/templates/components/not-active.hbs index 58d44bf2..77db3a1c 100644 --- a/app/templates/components/not-active.hbs +++ b/app/templates/components/not-active.hbs @@ -63,5 +63,5 @@

This is not an active repository

Want to start testing this project on Travis CI?

Read the Docs on Getting Started - +

If this repository is already in active use,
make sure it’s activated on {{#link-to "profile"}}your profile{{/link-to}}.

diff --git a/app/templates/repo.hbs b/app/templates/repo.hbs index 5a5082fb..fa452ec2 100644 --- a/app/templates/repo.hbs +++ b/app/templates/repo.hbs @@ -26,7 +26,11 @@ {{#if repo.active}} {{outlet}} {{else}} - {{not-active}} + {{#if repo.lastBuildId}} + {{outlet}} + {{else}} + {{not-active}} + {{/if}} {{/if}} From e4b689b0d56993ae54e8023ae56516212ec9b5e0 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Mon, 17 Aug 2015 10:15:09 +0200 Subject: [PATCH 2/2] display actiavte options on not-active of if user has pushPermissions --- app/controllers/builds.coffee | 2 +- app/templates/builds.hbs | 3 +-- app/templates/components/not-active.hbs | 4 +++- app/templates/repo.hbs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/builds.coffee b/app/controllers/builds.coffee index 681799df..956c9dbb 100644 --- a/app/controllers/builds.coffee +++ b/app/controllers/builds.coffee @@ -41,7 +41,7 @@ Controller = Ember.ArrayController.extend false ).property('tab', 'repo.builds', 'repo.branches') - things: (-> + noticeData: (-> return { repo: @get('repo'), auth: @auth.token() diff --git a/app/templates/builds.hbs b/app/templates/builds.hbs index c44c859e..86b77799 100644 --- a/app/templates/builds.hbs +++ b/app/templates/builds.hbs @@ -1,9 +1,8 @@ {{#if content.isLoaded}} -{{!-- --}} {{#each controller as |build|}} {{builds-item build=build}} {{else}} - {{no-builds repo=things isPR=displayPullRequests isBranch=displayBranches}} + {{no-builds repo=noticeData isPR=displayPullRequests isBranch=displayBranches}} {{/each}} {{#if displayShowMoreButton}}

diff --git a/app/templates/components/not-active.hbs b/app/templates/components/not-active.hbs index 77db3a1c..fd055090 100644 --- a/app/templates/components/not-active.hbs +++ b/app/templates/components/not-active.hbs @@ -63,5 +63,7 @@

This is not an active repository

Want to start testing this project on Travis CI?

Read the Docs on Getting Started -

If this repository is already in active use,
make sure it’s activated on {{#link-to "profile"}}your profile{{/link-to}}.

+ {{#if user.pushPermissions.length}} +

If this repository is already in active use,
make sure it’s activated on {{#link-to "account" repo.owner}}your profile{{/link-to}}.

+ {{/if}} diff --git a/app/templates/repo.hbs b/app/templates/repo.hbs index fa452ec2..090a8e79 100644 --- a/app/templates/repo.hbs +++ b/app/templates/repo.hbs @@ -29,7 +29,7 @@ {{#if repo.lastBuildId}} {{outlet}} {{else}} - {{not-active}} + {{not-active user=currentUser repo=repo}} {{/if}} {{/if}}