diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-02-17 19:36:52 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-02-17 19:36:52 +0100 |
commit | 8c3f19851eabb00b2626ce1b2eb22763404c5d49 (patch) | |
tree | aaf17097b3ed8743d5f887b0bfb7732ee3a10df3 | |
parent | 4b0854c3e66cd98ab2089c120ea615e9f35c8db9 (diff) | |
download | sonarqube-8c3f19851eabb00b2626ce1b2eb22763404c5d49.tar.gz sonarqube-8c3f19851eabb00b2626ce1b2eb22763404c5d49.zip |
Improve display of drilldowns
* SONAR-3273 Remove useless horizontal scrollbars on IE7
* SONAR-3242 The review buttons should not hide the violation title
8 files changed, 83 insertions, 67 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_footer.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_footer.html.erb index a2e095d5078..4c62051b374 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_footer.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_footer.html.erb @@ -9,3 +9,14 @@ <% end %> </script> <% end %> + +<!--[if lt IE 8]> +<script> + var columns=$$('.scrollable'); + columns.each(function(column) { + if (column.scrollHeight>column.offsetHeight) { + column.addClassName('scroll-ie'); + } + }); +</script> +<![endif]--> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb index 04a895828f1..e6d9c4650e6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb @@ -73,7 +73,7 @@ <%= link_to(resource.name, {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}) -%> <% end %> </td> - <td class="right last"> + <td class="right"> <%= format_measure(measure, :skip_span_id => true, :period => @period) -%> </td> </tr> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/violations.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/violations.html.erb index 3cab320c054..8d300485af4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/violations.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/violations.html.erb @@ -122,7 +122,7 @@ @drilldown.columns.each_with_index do |column, index| %> <% if first_column %> - <table class="width100 spacer-bottom" style="clear:left"> + <table class="spacer-bottom" style="width: 100%"> <tr> <% end %> <td class="<%= 'spacer-left' unless first_column -%>" nowrap> @@ -149,7 +149,7 @@ <%= link_to(h(resource.name), {:only_path => true, :overwrite_params => {:rids => (selected ? rids-[resource.id] : rids+[resource.id])}}) -%> <% end %> </td> - <td class="right last" nowrap> + <td class="right" nowrap> <%= @period ? format_variation(measure, :period => @period, :style => 'light') : measure.formatted_value -%> </td> </tr> @@ -179,7 +179,5 @@ <% if @drilldown.highlighted_resource %> d(<%= @drilldown.highlighted_resource.id -%>); <% end %> - </script> - <%= render :partial => 'footer' -%>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb index a45f05d58f2..53fe40a4d2a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb @@ -7,14 +7,40 @@ </div> <% end %> + <% if current_user %> + <img src="<%= ApplicationController.root_context -%>/images/actions.png" onclick="$('vActions<%= violation.id -%>').toggle();" class="pop-menu-icon"> + <ul style="display: none" class="popup-menu" id="vActions<%= violation.id -%>" onmouseout="this.hide();" onmouseover="this.show();"> + <li><%= link_to_function message('reviews.comment'), "sCF(#{violation.id})", :name => 'bComment' -%></li> + + <% unless violation.review && violation.review.resolved? %> + <li><%= link_to_function message('reviews.assign'), "sAF(#{violation.id})", :name => 'bAssign' -%></li> + <% end %> + + <% if !violation.switched_off? %> + <li><%= link_to_function (violation.review && violation.review.resolved? ? message('reviews.reopen') : message('reviews.resolved')), + "sCStF(#{violation.id})", :name => (violation.review && violation.review.resolved? ? 'bReopen' : 'bResolved') -%></li> + <% end %> + + <% if violation.review.nil? || violation.review.can_change_false_positive_flag? %> + <li><%= link_to_function message(violation.switched_off? ? 'reviews.unflag_as_false_positive' : 'reviews.flag_as_false_positive'), + "sFPF(#{violation.id})", + :name => 'bFalsePositive' -%></li> + <% end %> + + <% unless violation.review && violation.review.resolved? %> + <li><%= link_to_function message('reviews.change_severity'), "sCSF(#{violation.id})", :name => 'bChangeSeverity' -%></li> + <li><%= link_to_function message('reviews.link_to_action_plan'), "sAPF(#{violation.id})", :name => 'bLinkActionPlan' -%></li> + <% end %> + </ul> + + <% end %> + <% if violation.review && violation.review.manual_severity && violation.review.severity!=violation.severity %> <img src="<%= ApplicationController.root_context -%>/images/priority/<%= violation.review.severity -%>.png"> <% else %> <img src="<%= ApplicationController.root_context -%>/images/priority/<%= violation.failure_level -%>.png"> <% end %> - <%= image_tag 'sep12.png' -%> - <span class="rulename"> <a onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => violation.rule.key, :layout => 'false' -%>"><%= h(violation.rule.name) -%></a> </span> @@ -55,40 +81,6 @@ <div class="discussionComment first" id="vBody<%= violation.id -%>"> <div id="vMsg<%= violation.id -%>"> - - <% if current_user %> - <img src="<%= ApplicationController.root_context -%>/images/actions.png" onclick="$('vActions<%= violation.id -%>').toggle();" class="pop-menu-icon"> - <div style="display: none" class="popup-menu" id="vActions<%= violation.id -%>" onmouseout="this.hide();" onmouseover="this.show();"> - <ul> - <li><%= link_to_function message('reviews.comment'), "sCF(#{violation.id})", :name => 'bComment' -%></li> - - <% unless violation.review && violation.review.resolved? %> - <li><%= link_to_function message('reviews.assign'), "sAF(#{violation.id})", :name => 'bAssign' -%></li> - <% end %> - - <% if !violation.switched_off? %> - <li><%= link_to_function (violation.review && violation.review.resolved? ? message('reviews.reopen') : message('reviews.resolved')), - "sCStF(#{violation.id})", :name => (violation.review && violation.review.resolved? ? 'bReopen' : 'bResolved') -%></li> - <% end %> - - <% if violation.review.nil? || violation.review.can_change_false_positive_flag? %> - <li><%= link_to_function message(violation.switched_off? ? 'reviews.unflag_as_false_positive' : 'reviews.flag_as_false_positive'), - "sFPF(#{violation.id})", - :name => 'bFalsePositive' -%></li> - <% end %> - - <% unless violation.review && violation.review.resolved? %> - <li><%= link_to_function message('reviews.change_severity'), "sCSF(#{violation.id})", :name => 'bChangeSeverity' -%></li> - - <li><%= link_to_function message('reviews.link_to_action_plan'), "sAPF(#{violation.id})", :name => 'bLinkActionPlan' -%></li> - <% end %> - </ul> - </div> - - <%= image_tag 'sep12.png' -%> - - <% end %> - <%= violation.html_message || ' ' -%> </div> </div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb index e79d247e569..2cd0c9b02cf 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules/show.html.erb @@ -1,7 +1,6 @@ <h1><%= @rule.name %></h1> <div class="subtitle"> -<%= message('plugin') -%>: <%= @rule.plugin_name -%> -<%= message('key') -%>: <%= @rule.plugin_rule_key %> +<%= @rule.plugin_name -%> : <%= @rule.plugin_rule_key -%> </div> <div class="doc"> @@ -10,9 +9,9 @@ <% else %> <p><%= @rule.description %></p> <% end %> - + <% if @rule.note && !@rule.note.text.strip.blank? %> <p><%= @rule.note.html_text -%></p> <% end %> - + </div> diff --git a/sonar-server/src/main/webapp/images/actions.png b/sonar-server/src/main/webapp/images/actions.png Binary files differindex f0c364053bb..92692173f2f 100644 --- a/sonar-server/src/main/webapp/images/actions.png +++ b/sonar-server/src/main/webapp/images/actions.png diff --git a/sonar-server/src/main/webapp/javascripts/resource.js b/sonar-server/src/main/webapp/javascripts/resource.js index d9c49459e7e..193a8b4fe3e 100644 --- a/sonar-server/src/main/webapp/javascripts/resource.js +++ b/sonar-server/src/main/webapp/javascripts/resource.js @@ -34,6 +34,7 @@ function cancelViolationAction(violation_id) { // show the form to comment violation function sCF(violation_id) { + $('vActions' + violation_id).hide(); new Ajax.Updater('reviewForm' + violation_id, baseUrl + '/reviews/violation_comment_form/' + violation_id, { @@ -43,13 +44,14 @@ function sCF(violation_id) { $('vBody' + violation_id).remove(); $('reviewForm' + violation_id).show(); $('commentText' + violation_id).focus(); - } + } }); return false; } // show the form to change severity function sCSF(violation_id) { + $('vActions' + violation_id).hide(); new Ajax.Updater('reviewForm' + violation_id, baseUrl + '/reviews/violation_change_severity_form/' + violation_id, { @@ -66,6 +68,7 @@ function sCSF(violation_id) { // show the form to change status function sCStF(violation_id) { + $('vActions' + violation_id).hide(); new Ajax.Updater('reviewForm' + violation_id, baseUrl + '/reviews/violation_change_status_form/' + violation_id, { @@ -82,6 +85,7 @@ function sCStF(violation_id) { // show the form to flag as false-positive function sFPF(violation_id) { + $('vActions' + violation_id).hide(); new Ajax.Updater('reviewForm' + violation_id, baseUrl + '/reviews/violation_false_positive_form/' + violation_id, { @@ -98,6 +102,7 @@ function sFPF(violation_id) { // show the form to assign violation function sAF(violation_id) { + $('vActions' + violation_id).hide(); new Ajax.Updater('reviewForm' + violation_id, baseUrl + '/reviews/violation_assign_form/' + violation_id, { @@ -114,6 +119,7 @@ function sAF(violation_id) { // show the form to link a review to an action plan function sAPF(violation_id) { + $('vActions' + violation_id).hide(); new Ajax.Updater('reviewForm' + violation_id, baseUrl + '/reviews/violation_action_plan_form/' + violation_id, { diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index d40ce641f6e..f9dac91e4cc 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -427,24 +427,26 @@ button[disabled], .button[disabled], input[type="submit"][disabled], input[type= .popup-menu { background-clip: padding-box; background-color: #FFFFFF; - border-color: rgba(0, 0, 0, 0.2); + border-color: #DDD; border-style: solid; border-width: 1px; - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -o-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px #333; + -webkit-box-shadow: 0 5px 10px #333; + -o-box-shadow: 0 5px 10px #333; + box-shadow: 0 5px 10px #333; float: left; margin: 0; max-width: 220px; min-width: 160px; - padding: 0px; + padding: 0; position: absolute; + line-height: 20px; + z-index: 1000; } .popup-menu li { list-style-type: none !important; - padding: 2px 5px !important; + padding: 2px 8px !important; cursor: pointer !important; color: red !important; } @@ -585,16 +587,12 @@ h4, .h4 { } /* ------------------- DOCUMENTATION --------------------- */ -.doc { - margin: 0px 10px; -} - .doc h2 { - margin-top: 10px; + margin-top: 8px; } .doc p { - margin: 10px 0; + margin: 8px 0; } .doc pre, pre.code { @@ -941,6 +939,9 @@ div.vtitle { color: #777; border-bottom: 1px solid #DDDDDD; } +div.vtitle img { + vertical-align: text-bottom; +} span.falsePositive, span.reviewResolutionFALSE-POSITIVE { background-color: #FFF6BF; @@ -986,10 +987,6 @@ span.rulename a:hover { text-decoration: underline; } -.sources2 div.violation img { - vertical-align: sub; -} - .sources2 td.line { width: 100%; border-right: 1px solid #DDD; @@ -1806,11 +1803,10 @@ option.sev_BLOCKER { height: 144px; overflow: auto; border: 1px solid #ccc; - margin-right: 17px; } - -html>body .scrollable { - margin-right: 0; +.scroll-ie { + overflow-x: hidden; + padding-right: 17px; } .red { @@ -2472,3 +2468,17 @@ select.medium-width { max-width: 175px; width: 175px; } +.pipe-left { + background-image: url('../images/sep12.png'); + background-position: left center; + background-repeat: no-repeat; + padding-left: 8px; + margin-left: 8px; +} +.pipe-right { + background-image: url('../images/sep12.png'); + background-position: right center; + background-repeat: no-repeat; + margin-right: 8px; + padding-right: 8px; +}
\ No newline at end of file |