Move build status image button to the top right.

It takes up quite a bit of room on the tabs list, and it makes
more sense to have it up there, as it belongs to the repository.
This commit is contained in:
Mathias Meyer 2013-09-23 13:19:43 +02:00
parent a7f26ac4e2
commit 47f84d5b5b
4 changed files with 36 additions and 30 deletions

View File

@ -1,12 +1,5 @@
<div id="actions">
<ul>
{{#if view.displayStatusImages}}
<li id="status-image-popup">
<a href="#" name="status-images" class="open-popup" {{action "statusImages" target="view"}} style="margin-top: 0px;">
<img {{bindAttr src="view.statusImageUrl"}} title="Build Status Images"/>
</a>
</li>
{{/if}}
{{#if view.displayCancelBuild}}
<li class="icon">
<a href="#" {{action "cancelBuild" target="view"}}

View File

@ -12,6 +12,13 @@
</li>
{{/if}}
</ul>
{{#if view.displayStatusImages}}
<a href="#" id="status-image-popup" name="status-images" class="open-popup" {{action "statusImages" target="view"}}>
<img {{bindAttr src="view.statusImageUrl"}} title="Build Status Images"/>
</a>
{{/if}}
</div>
<div id="regenerate-key" class="popup">

View File

@ -78,6 +78,7 @@ Travis.reopen
jobBinding: 'controller.job'
tabBinding: 'controller.tab'
currentUserBinding: 'controller.currentUser'
slugBinding: 'controller.repo.slug'
closeMenu: ->
$('.menu').removeClass('display')
@ -114,16 +115,6 @@ Travis.reopen
permissions.contains parseInt(@get('repo.id'))
).property('currentUser.permissions.length', 'repo.id')
RepoActionsView: Travis.View.extend
templateName: 'repos/show/actions'
repoBinding: 'controller.repo'
buildBinding: 'controller.build'
jobBinding: 'controller.job'
tabBinding: 'controller.tab'
slugBinding: 'controller.repo.slug'
currentUserBinding: 'controller.currentUser'
statusImageUrl: (->
Travis.Urls.statusImage(@get('slug'))
).property('slug')
@ -132,6 +123,23 @@ Travis.reopen
@get('hasPermission')
).property('hasPermission')
statusImages: ->
@popupCloseAll()
view = Travis.StatusImagesView.create(toolsView: this)
Travis.View.currentPopupView = view
view.appendTo($('body'))
event.stopPropagation()
RepoActionsView: Travis.View.extend
templateName: 'repos/show/actions'
repoBinding: 'controller.repo'
buildBinding: 'controller.build'
jobBinding: 'controller.job'
tabBinding: 'controller.tab'
currentUserBinding: 'controller.currentUser'
requeue: ->
@get('build').requeue()
@ -228,7 +236,7 @@ Travis.reopen
codeClimatePopup: ->
@popupCloseAll()
@popup('code-climate')
event.stopPropagation()
event.stopPropagation() if event?
requeueBuild: ->
if @get('canRequeueBuild')
@ -238,10 +246,4 @@ Travis.reopen
if @get('canRequeueJob')
@get('job').requeue()
statusImages: ->
@popupCloseAll()
view = Travis.StatusImagesView.create(toolsView: this)
Travis.View.currentPopupView = view
view.appendTo($('body'))
event.stopPropagation()

View File

@ -4,7 +4,7 @@
position: relative
float: right
top: 2px
width: 200px
width: 300px
& > a.menu-popup-button
display: block
@ -36,6 +36,15 @@
cursor: default
color: $color-link-disabled
a#status-image-popup
float: right
display: block
opacity: 0.5
margin-top: -27px
margin-right: 45px
&:hover
opacity: 1.0
#code-climate
a
text-decoration: underline
@ -52,11 +61,6 @@
float: right
text-align: right
li#status-image-popup
opacity: 0.5
&:hover
opacity: 1.0
li.icon
a
-webkit-border-radius: .5em