add link to docs on requests if branch is gh-pages

This commit is contained in:
Lisa P 2016-01-05 11:51:57 +01:00
parent 0813d8cd45
commit 7aa77b4f6f
5 changed files with 78 additions and 4 deletions

View File

@ -0,0 +1,49 @@
`import Ember from 'ember'`
`import config from 'travis/config/environment'`
RequestsItemComponent = Ember.Component.extend
classNames: ['request-item']
classNameBindings: ['requestClass']
tagName: 'li'
requestClass: (->
if @get('request.isAccepted')
'accepted'
else
'rejected'
).property('content.isAccepted')
type: (->
if @get('request.isPullRequest')
'pull_request'
else
'push'
).property('request.isPullRequest')
status: (->
if @get('request.isAccepted')
'Accepted'
else
'Rejected'
).property('request.isAccepted')
hasBranchName: (->
@get('request.branchName')
).property('request')
message: (->
message = @get('request.message')
if message == 'github pages branch'
@set('isGHPages', true)
if config.pro && message == "private repository"
''
else if !message
'Build created successfully '
else
message
).property('request.message')
`export default RequestsItemComponent`

View File

@ -37,6 +37,10 @@ export default Ember.Component.extend({
message: function() {
var message;
message = this.get('request.message');
if (message === 'github pages branch') {
this.set('isGHPages', true);
}
if (config.pro && message === "private repository") {
return '';
} else if (!message) {

View File

@ -14,6 +14,7 @@
list-style: none
.request-item
position: relative
border: 1px solid $cream-dark
margin-bottom: 5px
font-size: 15px
@ -46,8 +47,6 @@
align-items: center
padding: .3em 0
white-space: nowrap
.row-item
overflow: hidden
.row-item:first-of-type
flex: 0 0 3em
@ -64,4 +63,3 @@
flex: 0 0 8%
.row-item:last-of-type
flex: 0 0 20%

View File

@ -107,3 +107,19 @@
right: 0
margin: auto
.tooltip--requests
@extend %tooltip
position: absolute
right: 0
bottom: 0
.tooltip-trigger
margin: .2em .5em
.tooltip-bubble
top: -3.6em
right: 0
width: 10em
height: 3em
white-space: normal
&:before
right: .8em

View File

@ -33,5 +33,12 @@
</div>
<div class="row-item fade-out">
<span class="label-align">{{message}}</span>
<span class="label-align">{{message}} </span>
</div>
{{#if isGHPages}}
<a class="tooltip--requests" href="https://docs.travis-ci.com/user/customizing-the-build/#Whitelisting-or-blacklisting-branches" title="Branch whitelisting - Travis CI Docs">
<span class="icon-question tooltip-trigger" aria-label="Help"></span>
<span class="tooltip-bubble">Read about branch whitelisting</span>
</a>
{{/if}}