tweak some styles and responsive behaviour

This commit is contained in:
Lisa P 2015-09-15 17:59:15 +02:00
parent 4dc5c03077
commit e8fb719591
6 changed files with 63 additions and 34 deletions

View File

@ -34,7 +34,7 @@ BranchRowComponent = Ember.Component.extend
if @get('auth.signedIn') if @get('auth.signedIn')
options.headers = { Authorization: "token #{@auth.token()}" } options.headers = { Authorization: "token #{@auth.token()}" }
$.ajax("#{apiEndpoint}/v3/repo/#{repoId}/builds?branch.name=#{branchName}&limit=5&offset=1", options).then (response) -> $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/builds?branch.name=#{branchName}&limit=5", options).then (response) ->
array = response.builds.map( (build) -> array = response.builds.map( (build) ->
Ember.Object.create(build) Ember.Object.create(build)
) )
@ -49,17 +49,27 @@ BranchRowComponent = Ember.Component.extend
lastBuilds lastBuilds
).property() ).property()
triggeredBuild: (->
triggeredBuild = Ember.ArrayProxy.create(
isTriggered: false,
status: null
)
).property("triggeredBuild.status['@type']")
triggerBuild: (-> triggerBuild: (->
apiEndpoint = config.apiEndpoint apiEndpoint = config.apiEndpoint
repoId = @get('build.repository.id') repoId = @get('build.repository.id')
branchName = @get('build.name')
options = { options = {
type: 'POST' type: 'POST'
} }
if @get('auth.signedIn') if @get('auth.signedIn')
options.headers = { Authorization: "token #{@auth.token()}" } options.headers = { Authorization: "token #{@auth.token()}" }
$.ajax("#{apiEndpoint}/v3/repo/#{repoId}/requests", options).then (response) -> $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/requests", options).then (response) ->
console.log(response); @triggerBuild.set('isTriggered', true)
console.log('Build triggered'); @triggerBuild.set('status', response)
console.log(response)
console.log('Build triggered')
) )
actions: actions:

View File

@ -14,7 +14,6 @@ BranchesController = Ember.Controller.extend
activeBranches: (-> activeBranches: (->
repos = @get('model') repos = @get('model')
repos = repos.filter (item, index) -> repos = repos.filter (item, index) ->
console.log(item)
item if item.exists_on_github == true && item.repository.default_branch.name != undefined item if item.exists_on_github == true && item.repository.default_branch.name != undefined
.sortBy('last_build.finished_at') .sortBy('last_build.finished_at')
.reverse() .reverse()

View File

@ -28,7 +28,7 @@
position: relative position: relative
display: inline-block display: inline-block
height: 100% height: 100%
width: 18.8% width: 18.7%
background-color: #F7F7F7 background-color: #F7F7F7
.status-icon .status-icon
position: absolute position: absolute

View File

@ -64,7 +64,7 @@
& > div:nth-of-type(4) & > div:nth-of-type(4)
width: 5% width: 5%
& > div:nth-of-type(5) & > div:nth-of-type(5)
width: 26% width: 27%
@include statusColors($green-dark, 'passed') @include statusColors($green-dark, 'passed')
@include statusColors($red-dark, 'failed') @include statusColors($red-dark, 'failed')
@ -76,7 +76,6 @@
@include statusColors(#bfb502, 'received', #e5db29) @include statusColors(#bfb502, 'received', #e5db29)
@include statusColors(#bfb502, 'created', #e5db29) @include statusColors(#bfb502, 'created', #e5db29)
%row-element %row-element
vertical-align: middle vertical-align: middle
@media #{$medium-up} @media #{$medium-up}
@ -99,9 +98,22 @@
display: inline-block display: inline-block
.branch-nav .branch-nav
display: none display: none
text-align: center
@media #{$medium-up} @media #{$medium-up}
display: block display: block
.branch-last-build
@media #{$medium-up}
padding-left: 1em
&:before
content: "";
display: block;
width: 1px;
background-color: #EFF0EC;
position: absolute;
height: 3.7em;
margin-left: -1em;
// @todo refactor into dropup module // @todo refactor into dropup module
%dropup %dropup
@media #{$medium-up} @media #{$medium-up}
@ -120,10 +132,7 @@
height: 10px height: 10px
left: 46% left: 46%
transform: rotate(45deg) transform: rotate(45deg)
&:before
bottom: -6px
&:after &:after
bottom: -4px
background-color: $white background-color: $white
.dropup-trigger:hover ~ &, .dropup-trigger:hover ~ &,
.dropup-trigger:hover &, .dropup-trigger:hover &,
@ -132,6 +141,10 @@
.dropup--blue .dropup--blue
@extend %dropup @extend %dropup
&:before
bottom: -5px
&:after
bottom: -4px
ul ul
margin: 0 margin: 0
padding: 0 padding: 0
@ -152,13 +165,15 @@
fill: $white fill: $white
@media #{$medium-up} @media #{$medium-up}
padding: .4em padding: .5em
transform: translate(-2.7em, -8.2em) transform: translate(-37%, -180%)
border: 1px solid $teal-dark border: 1px solid $teal-dark
li li
display: block display: block
margin: 0 margin: 0
background-color: $white background-color: $white
&:first-of-type
border-bottom: 1px solid #E4E6E6
.icon-trigger path, .icon-trigger path,
.icon-eye path .icon-eye path
fill: #A7AEAE fill: #A7AEAE
@ -174,6 +189,10 @@
.icon-eye path .icon-eye path
fill: $white fill: $white
@media #{$large-up}
padding: .5em
transform: translate(-30%, -180%)
&:before &:before
background-color: $teal-dark background-color: $teal-dark
@ -182,6 +201,8 @@
display: none display: none
&:after &:after
bottom: -5px bottom: -5px
&:before
bottom: -6px
@media #{$medium-up} @media #{$medium-up}
top: -3em top: -3em
padding: .2em .3em padding: .2em .3em
@ -210,7 +231,7 @@
vertical-align: middle vertical-align: middle
width: 5px width: 5px
height: 5px height: 5px
border: solid 1px #e5db29 border: solid 1px #bfb502
border-radius: 50% border-radius: 50%
transform-origin: center center transform-origin: center center

View File

@ -27,11 +27,4 @@
</ul> </ul>
</section> </section>
{{/if}} {{/if}}
{{!-- {{#if content.isLoaded}} --}}
{{!-- {{else}}
{{loading-indicator}}
{{/if}} --}}
</div> </div>

View File

@ -31,7 +31,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="two-line"> <div class="two-line branch-last-build">
<div class="branch-request"> <div class="branch-request">
<div class="row-item"> <div class="row-item">
{{#if build.last_build}} {{#if build.last_build}}
@ -136,7 +136,9 @@
</div> </div>
<div class="dropup--blue"> <div class="dropup--blue">
<ul> <ul>
<li><a {{action 'tiggerBuild'}}> <li>
{{#unless triggeredBuild.isTriggered}}
<a {{action 'tiggerBuild'}}>
<span class="icon-trigger"> <span class="icon-trigger">
<svg x="0px" y="0px" viewBox="0 0 20 20" xml:space="preserve"> <svg x="0px" y="0px" viewBox="0 0 20 20" xml:space="preserve">
<g id="Trigger"> <g id="Trigger">
@ -147,7 +149,11 @@
</g> </g>
</svg> </svg>
</span> </span>
Trigger a build</a> Trigger a build
</a>
{{else}}
processing request
{{/unless}}
</li> </li>
<li><a {{action 'viewAllBuilds'}}> <li><a {{action 'viewAllBuilds'}}>
<span class="icon-eye"> <span class="icon-eye">