Link commit on requests list to github
This commit is contained in:
parent
57edf811b7
commit
1a0d004aeb
|
@ -309,6 +309,15 @@ Ember.registerBoundHelper 'capitalize', (value, options) ->
|
|||
else
|
||||
''
|
||||
|
||||
Ember.Handlebars.helper('githubCommitLink', (slug, commitSha) ->
|
||||
return '' unless commitSha
|
||||
sha = Handlebars.Utils.escapeExpression Travis.Helpers.formatCommit(commitSha)
|
||||
return sha unless slug
|
||||
url = Handlebars.Utils.escapeExpression Travis.Urls.githubCommit(slug, sha)
|
||||
|
||||
safe '<a class="github-link only-on-hover" href="' + url + '">' + sha + '</a>'
|
||||
)
|
||||
|
||||
Ember.registerBoundHelper 'formatTime', (value, options) ->
|
||||
safe Travis.Helpers.timeAgoInWords(value) || '-'
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ require 'travis/model'
|
|||
pullRequestTitle: Ember.attr('string')
|
||||
pullRequestNumber: Ember.attr(Number)
|
||||
|
||||
repo: Ember.belongsTo('Travis.Request', key: 'repository_id')
|
||||
repo: Ember.belongsTo('Travis.Repo', key: 'repository_id')
|
||||
commit: Ember.belongsTo('Travis.Commit', key: 'commit_id')
|
||||
build: Ember.belongsTo('Travis.Build', key: 'build_id')
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<span class="status"></span>
|
||||
{{request.id}}
|
||||
</td>
|
||||
<td>{{formatSha request.commit.sha}}</td>
|
||||
<td>{{githubCommitLink request.repo.slug request.commit.sha}}</td>
|
||||
<td>
|
||||
{{#if build}}
|
||||
{{#link-to "build" build}}#{{build.number}}{{/link-to}}
|
||||
|
|
|
@ -21,3 +21,13 @@ ul
|
|||
li
|
||||
padding: 0
|
||||
|
||||
.github-link
|
||||
background: transparent url(/images/icons/github.png) center right no-repeat
|
||||
background-size: 12px
|
||||
opacity: 1
|
||||
padding-right: 16px
|
||||
|
||||
&.only-on-hover
|
||||
background-image: none
|
||||
&.only-on-hover:hover
|
||||
background-image: url(/images/icons/github.png)
|
||||
|
|
Loading…
Reference in New Issue
Block a user