change tools button to have a menu, add requeue menu item, make status image stuff a popup
This commit is contained in:
parent
25dffc0a7a
commit
02a1f166d5
|
@ -43,7 +43,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git://github.com/travis-ci/travis-api.git
|
||||
revision: 8abc3309372e8a9c4e3506cbf45362c49e91b24d
|
||||
revision: 2b290b9571db627cd796b4d11d5c6153b8d649c1
|
||||
specs:
|
||||
travis-api (0.0.1)
|
||||
backports (~> 2.5)
|
||||
|
@ -61,7 +61,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git://github.com/travis-ci/travis-core.git
|
||||
revision: 94dbbf2fea57b56383e26152ae3a4cece02d2df0
|
||||
revision: 05ea6a6696b3be32839afcaa126afaf3f2522536
|
||||
branch: sf-travis-api
|
||||
specs:
|
||||
travis-core (0.0.1)
|
||||
|
|
BIN
assets/images/ui/close.png
Normal file
BIN
assets/images/ui/close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -1,6 +1,6 @@
|
|||
require 'travis/model'
|
||||
|
||||
@Travis.Build = Travis.Model.extend Travis.DurationCalculations,
|
||||
@Travis.Build = Travis.Model.extend Travis.DurationCalculations, Travis.Ajax,
|
||||
eventType: DS.attr('string')
|
||||
repoId: DS.attr('number')
|
||||
commitId: DS.attr('number')
|
||||
|
@ -26,6 +26,10 @@ require 'travis/model'
|
|||
@get('data.job_ids.length') > 1
|
||||
).property('data.job_ids.length')
|
||||
|
||||
isFinished: (->
|
||||
@get('state') == 'finished'
|
||||
).property('state')
|
||||
|
||||
requiredJobs: (->
|
||||
@get('jobs').filter (data) -> !data.get('allowFailure')
|
||||
).property('jobs.@each.allowFailure')
|
||||
|
@ -41,6 +45,10 @@ require 'travis/model'
|
|||
$.map(headers.concat(keys), (key) -> return $.camelize(key))
|
||||
).property('config')
|
||||
|
||||
requeue: (->
|
||||
@post '/requests', build_id: @get('id')
|
||||
)
|
||||
|
||||
@Travis.Build.reopenClass
|
||||
byRepoId: (id, parameters) ->
|
||||
@find($.extend(parameters || {}, repository_id: id))
|
||||
|
|
|
@ -27,7 +27,7 @@ require 'travis/model'
|
|||
permissions: (->
|
||||
unless @permissions
|
||||
@permissions = Ember.ArrayProxy.create()
|
||||
@ajax '/users/permissions', 'get', success: (data) => @permissions.set('content', data).permissions
|
||||
@ajax '/users/permissions', 'get', success: (data) => @permissions.set('content', data.permissions)
|
||||
@permissions
|
||||
).property()
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
{{#unless view.required}}
|
||||
<div id="help-allowed_failures" class="popup">
|
||||
<a href="#" class="close" {{action popupClose target="view"}}></a>
|
||||
<h4>{{t "jobs.allowed_failures"}}</h4>
|
||||
<p>
|
||||
Allowed Failures are items in your build matrix that are allowed to
|
||||
|
|
|
@ -1,29 +1,41 @@
|
|||
<div id="tools">
|
||||
<a href="#" {{action toggle target="view"}}></a>
|
||||
<div class="pane">
|
||||
<p>
|
||||
<label>{{t repositories.branch}}:</label>
|
||||
{{#if view.branches.isLoaded}}
|
||||
{{view Ember.Select contentBinding="view.branches" selectionBinding="view.branch" optionLabelPath="content.commit.branch" optionValuePath="content.commit.branch"}}
|
||||
{{else}}
|
||||
<span class="loading"></span>
|
||||
{{/if}}
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.image_url}}:</label>
|
||||
<input type="text" class="url" {{bindAttr value="view.urlStatusImage"}}></input>
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.markdown}}:</label>
|
||||
<input type="text" class="markdown" {{bindAttr value="view.markdownStatusImage"}}></input>
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.textile}}:</label>
|
||||
<input type="text" class="textile" {{bindAttr value="view.textileStatusImage"}}></input>
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.rdoc}}:</label>
|
||||
<input type="text" class="rdoc" {{bindAttr value="view.rdocStatusImage"}}></input>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" {{action menu target="view"}}></a>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<a href="#" name="status-images" {{action statusImages target="view"}}>Status Images</a>
|
||||
</li>
|
||||
{{#if view.canPush}}
|
||||
<li>
|
||||
<a href="#" {{action requeue target="view"}}>Rebuild</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="status-images" class="popup">
|
||||
<a href="#" class="close" {{action popupClose target="view"}}></a>
|
||||
<p>
|
||||
<label>{{t repositories.branch}}:</label>
|
||||
{{#if view.branches.isLoaded}}
|
||||
{{view Ember.Select contentBinding="view.branches" selectionBinding="view.branch" optionLabelPath="content.commit.branch" optionValuePath="content.commit.branch"}}
|
||||
{{else}}
|
||||
<span class="loading"></span>
|
||||
{{/if}}
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.image_url}}:</label>
|
||||
<input type="text" class="url" {{bindAttr value="view.urlStatusImage"}}></input>
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.markdown}}:</label>
|
||||
<input type="text" class="markdown" {{bindAttr value="view.markdownStatusImage"}}></input>
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.textile}}:</label>
|
||||
<input type="text" class="textile" {{bindAttr value="view.textileStatusImage"}}></input>
|
||||
</p>
|
||||
<p>
|
||||
<label>{{t repositories.rdoc}}:</label>
|
||||
<input type="text" class="rdoc" {{bindAttr value="view.rdocStatusImage"}}></input>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,13 @@ require 'ext/ember/namespace'
|
|||
@Travis.reopen
|
||||
View: Em.View.extend
|
||||
popup: (event) ->
|
||||
@popupCloseAll()
|
||||
$("##{event.target.name}").toggleClass('display')
|
||||
popupClose: (event) ->
|
||||
$(event.target).closest('.popup').removeClass('display')
|
||||
popupCloseAll: ->
|
||||
$('.popup').removeClass('display')
|
||||
|
||||
|
||||
@Travis.reopen
|
||||
HomeView: Travis.View.extend(templateName: 'layouts/home')
|
||||
|
|
|
@ -65,9 +65,33 @@
|
|||
jobBinding: 'controller.job'
|
||||
tabBinding: 'controller.tab'
|
||||
|
||||
toggle: ->
|
||||
element = $('#tools .pane').toggleClass('display-inline')
|
||||
@set('active', element.hasClass('display-inline'))
|
||||
closeMenu: ->
|
||||
$('.menu').removeClass('display')
|
||||
|
||||
menu: ->
|
||||
@popupCloseAll()
|
||||
element = $('#tools .menu').toggleClass('display')
|
||||
|
||||
requeue: ->
|
||||
@closeMenu()
|
||||
@get('build').requeue()
|
||||
|
||||
statusImages: (event) ->
|
||||
@set('active', true)
|
||||
@closeMenu()
|
||||
@popup(event)
|
||||
|
||||
canPush: (->
|
||||
@get('isBuildTab') && @get('build.isFinished') && @get('hasPushPermissions')
|
||||
).property('build.isFinished', 'hasPushPermissions', 'isBuildTab')
|
||||
|
||||
isBuildTab: (->
|
||||
['current', 'build', 'job'].indexOf(@get('tab')) > -1
|
||||
).property('tab')
|
||||
|
||||
hasPushPermissions: (->
|
||||
Travis.app.get('currentUser.permissions').indexOf(@get('repo.id')) > -1
|
||||
).property('Travis.app.currentUser.permissions.length', 'repo.id')
|
||||
|
||||
branches: (->
|
||||
@get('repo.branches') if @get('active')
|
||||
|
|
|
@ -68,6 +68,8 @@ $color-bg-list-odd: $white
|
|||
$color-bg-list-even: $gray-light-3
|
||||
$color-bg-hooks-odd: $slate-blue-4
|
||||
$color-bg-hooks-even: $white
|
||||
$color-bg-menu: $gray-light-4
|
||||
$color-bg-menu-hover: $gray-light-3
|
||||
$color-bg-tools-pane: $slate-blue-3
|
||||
$color-bg-right: $slate-blue-3
|
||||
$color-bg-sidebar-box: $white
|
||||
|
|
|
@ -17,6 +17,15 @@
|
|||
padding: 20px
|
||||
@include popup
|
||||
|
||||
.close
|
||||
position: absolute
|
||||
display: block
|
||||
right: 10px
|
||||
top: 10px
|
||||
width: 16px
|
||||
height: 16px
|
||||
background: inline-image('ui/close.png') no-repeat 0 0
|
||||
|
||||
h4
|
||||
margin-top: 0
|
||||
font-size: 18px
|
||||
|
@ -32,3 +41,22 @@
|
|||
padding: 10px 20px
|
||||
@include border-radius(4px)
|
||||
|
||||
#status-images
|
||||
display: none
|
||||
position: absolute
|
||||
width: 600px
|
||||
height: 190px
|
||||
margin: -145px 0 0 -300px
|
||||
|
||||
p
|
||||
margin: 10px 0
|
||||
label
|
||||
width: 80px
|
||||
display: inline-block
|
||||
input
|
||||
border: 1px solid $color-border-light
|
||||
width: 505px
|
||||
padding: 4px
|
||||
@include border-radius(3px)
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
position: relative
|
||||
width: 100%
|
||||
overflow-x: hidden
|
||||
padding-right: 10px
|
||||
|
||||
.description, .language
|
||||
font-weight: normal
|
||||
|
@ -16,7 +17,7 @@
|
|||
.github-stats
|
||||
position: absolute
|
||||
top: 15px
|
||||
right: 0
|
||||
right: 10px
|
||||
> *
|
||||
float: left
|
||||
a
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
#tools
|
||||
position: relative
|
||||
float: right
|
||||
a
|
||||
top: 2px
|
||||
& > a
|
||||
display: block
|
||||
width: 39px
|
||||
height: 21px
|
||||
|
@ -11,28 +12,20 @@
|
|||
background: inline-image('ui/tools-button.png') no-repeat
|
||||
cursor: pointer
|
||||
|
||||
.pane
|
||||
.menu
|
||||
display: none
|
||||
position: absolute
|
||||
z-index: 400
|
||||
top: -1px
|
||||
right: 0
|
||||
width: 600px
|
||||
padding: 10px 20px
|
||||
top: -3px
|
||||
width: 130px
|
||||
background-color: $color-bg-menu
|
||||
border: 1px solid $color-border-light
|
||||
background-color: $color-bg-tools-pane
|
||||
@include border-bottom-radius(4px)
|
||||
@include single-box-shadow(rgba(black, 0.1), 1px, 3px, 5px)
|
||||
|
||||
p
|
||||
margin: 10px 0
|
||||
label
|
||||
width: 80px
|
||||
display: inline-block
|
||||
input
|
||||
border: 1px solid $color-border-light
|
||||
width: 505px
|
||||
padding: 4px
|
||||
@include border-radius(3px)
|
||||
|
||||
|
||||
@include single-box-shadow(rgba(black, 0.1), 3px, 3px, 8px)
|
||||
a
|
||||
display: block
|
||||
padding: 5px 25px 5px 25px
|
||||
&:hover
|
||||
background-color: $color-bg-menu-hover
|
||||
&:last-child
|
||||
@include border-bottom-radius(4px)
|
||||
|
|
|
@ -2,6 +2,7 @@ require 'rake-pipeline'
|
|||
require 'execjs'
|
||||
require 'uglifier'
|
||||
require 'pathname'
|
||||
require 'json'
|
||||
|
||||
module Travis
|
||||
class Assets
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -1 +1 @@
|
|||
b63092e5
|
||||
1dcac772
|
Loading…
Reference in New Issue
Block a user