test_viewer.expand=expand
test_viewer.collapse=collapse
test_viewer.covered_lines=Covered Lines
+test_viewer.tests_covering=Tests covering {0} on line {1}
+test_viewer.files_covered_by=Files covered by {0} ({1})
#------------------------------------------------------------------------------
<div class="accordion-item">
<div class="accordion-item-header">
<div class="source_title">
- <div class="subtitle">Tests covering <%= @testable.component.longName %> on line <%= @line %></div>
+ <div class="subtitle"><%= message('test_viewer.tests_covering', :params => {@testable.component.longName, @line}) %></div>
</div>
</div>
<div class="accordion-item-body">
<table class="data marginbottom10">
<tbody>
<% reset_cycle %>
- <% test_cases.sort_by { |test_case| test_case.name }.each do |test_case|
- reset_cycle
- %>
+ <% test_cases.sort_by { |test_case| test_case.name }.each do |test_case| %>
<tr class="<%= cycle('even', 'odd') -%>">
<td class="thin" nowrap>
<img src="<%= ApplicationController.root_context + "/images/test/" + test_case.status.name + ".png" -%>"/>
<div class="accordion-item">
<div class="accordion-item-header">
- <h3>Files covered by <%= @test %> (<%= @test_plan.component.longName %>)</h3>
+ <h3><%= message('test_viewer.files_covered_by', :params => {@test, @test_plan.component.longName}) %></h3>
</div>
<br/>
<div class="accordion-item-body">
<table class="data">
<thead>
<tr>
- <th>File</th>
- <th>Covered Lines</th>
+ <th class="thin" nowrap><%= message('test_viewer.covered_lines') %></th>
+ <th><%= message('file') %></th>
</tr>
</thead>
<tbody>
<% @test_case.coverageBlocks.sort_by{|cover| cover.testable.component.name}.each do |cover|
- reset_cycle
%>
<tr class="<%= cycle("even", "odd") -%>">
+ <td><%= cover.lines.size -%></td>
<td>
<a href="<%= ApplicationController.root_context -%>/resource/index/<%= cover.testable.component.key -%>?display_title=true&tab=coverage&coverage_filter=lines_covered_per_test&test_case_filter=<%= @test -%>"
onclick="openAccordionItem(this.href, this); return false;"><%= cover.testable.component.longName -%>
</a>
</td>
- <td><%= cover.lines.size -%></td>
</tr>
<% end %>
</tbody>
loading.hide();
}
+ // Remove elements under current element
if (currentElement.length) {
+ // Fix the height in order to not change the position on the screen when removing elements under current element
var elementToRemove = currentElement.nextAll('.'+ htmlClass);
if (elementToRemove.height()) {
$j("#accordion-panel").height($j("#accordion-panel").height() + elementToRemove.height());
}
if (updateCurrentElement) {
+ // Fix the height in order to not change the position on the screen
var prev = $j("#accordion-panel").height();
currentElement.replaceWith(html);
if (prev > $j("#accordion-panel").height()) {
$j("#accordion-panel").height(prev);
}
} else {
+ // Add new item add the end of the panel and restore the height param
$j("#accordion-panel").append(html);
$j("#accordion-panel").height('auto');
- // Set the focus on the top of the current item
+ // Set the focus on the top of the current item with animation
if (currentElement.length) {
$j('html, body').animate({
scrollTop: currentElement.offset().top},