Skip to content

Commit

Permalink
live notifications eye-candy
Browse files Browse the repository at this point in the history
  • Loading branch information
comboy committed Apr 7, 2012
1 parent a62c5e9 commit a62ed7a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
16 changes: 12 additions & 4 deletions app/assets/javascripts/webs.js.coffee
@@ -1,6 +1,5 @@

$(document).ready ->
window.WEB_SOCKET_SWF_LOCATION = '/WebSocketMain.swf'
jug = new Juggernaut
jug.subscribe "moci", (data) ->
console.log("Got data: " + JSON.stringify(data))
Expand Down Expand Up @@ -35,10 +34,19 @@ $(document).ready ->
tr_details = $('.last_runs .details.test_suite_run_'+tsr_id)
if tr_details.length != 0
tr_details.find('.current_test_unit').html(d['test_unit']['class_name'] + ' :: ' + d['test_unit']['name'])
tr_details.removeClass('tu_state_waiting')
tr_details.removeClass('tu_state_ok')
tr_details.removeClass('tu_state_fail')
switch d['result']
when 'W'
tr_details.addClass('tu_state_waiting')
when 'E', 'F'
tr_details.addClass('tu_state_fail')
when '.'
tr_details.addClass('tu_state_ok')
else

if $('.last_runs tr').length > 12
$('.last_runs tr.state_finished').slice(-6).hide()
if $('.last_runs tr.state_finished').length > 12
$('.last_runs tr.state_finished').slice(-6).remove()



34 changes: 33 additions & 1 deletion app/assets/stylesheets/mystyle.css
Expand Up @@ -29,13 +29,45 @@ table.last_runs {

table.last_runs tr.state_running.details {
display: table-row;
text-align: center;
text-align: left;
}

table.last_runs tr.state_finished.details {
display: none;
}

table.last_runs tr.state_finished td.info .time {
display: inline;
}

table.last_runs tr.state_finished td.info .spinner {
display: none;
}

table.last_runs tr.state_running td.info .time {
display: none;
}

table.last_runs tr.state_running td.info .spinner {
display: inline;
}

table.last_runs tr.details .current_test_unit {
font-size: 9px;
}

table.last_runs tr.details.tu_state_ok {
background-color:#FFF5CC;
}

table.last_runs tr.details.tu_state_waiting {
background-color:#FFF5CC;
}

table.last_runs tr.details.tu_state_fail {
background-color:#FEEBEB;
}

table.no_border {
border-width: 0px;
}
Expand Down
7 changes: 5 additions & 2 deletions app/views/projects/_tr_last_run.html.haml
@@ -1,8 +1,11 @@
%tr{:class => "test_suite_run_#{tsr.id} state_#{tsr.state}"}
%td= tsr.updated_at
%td.info
.time
= tsr.updated_at
.spinner
= image_tag 'ajax_inline2.gif'
%td= tsr.test_suite.name
%td.state= tsr.state
%tr{:class => "test_suite_run_#{tsr.id} details state_#{tsr.state}"}
%td{:colspan => 3}
= image_tag 'ajax_inline2.gif'
%span.current_test_unit

0 comments on commit a62ed7a

Please sign in to comment.