diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-02-11 19:13:44 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-02-11 19:14:01 +0100 |
commit | 16a3d73072d4b52a9da23e585b8545b3454c5436 (patch) | |
tree | fffffb71d7e7d56c500cb82e4f03b2f90dcd676d /sonar-server | |
parent | bf394b048ce48eb021a2f64146ba5d8ba039bebe (diff) | |
download | sonarqube-16a3d73072d4b52a9da23e585b8545b3454c5436.tar.gz sonarqube-16a3d73072d4b52a9da23e585b8545b3454c5436.zip |
Add messages on tests component
Diffstat (limited to 'sonar-server')
3 files changed, 11 insertions, 10 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable.html.erb index 9af43f406b7..30b301a7bbe 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable.html.erb @@ -1,7 +1,7 @@ <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"> @@ -13,9 +13,7 @@ <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" -%>"/> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testcase.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testcase.html.erb index f3a2f968311..c82d5cabb85 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testcase.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testcase.html.erb @@ -1,27 +1,26 @@ <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> diff --git a/sonar-server/src/main/webapp/javascripts/application.js b/sonar-server/src/main/webapp/javascripts/application.js index 57a73610582..4d8f272d273 100644 --- a/sonar-server/src/main/webapp/javascripts/application.js +++ b/sonar-server/src/main/webapp/javascripts/application.js @@ -338,7 +338,9 @@ function openAccordionItem(url, elt, updateCurrentElement) { 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()); @@ -365,16 +367,18 @@ function openAccordionItem(url, elt, updateCurrentElement) { } 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}, |