diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-04-20 18:49:33 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-04-20 18:54:16 +0200 |
commit | 07b20316ee247a1694eb9191f985cb2de2d08b49 (patch) | |
tree | 2371f7a66774101e1e22358c0b592677c5892c3e /sonar-server | |
parent | b9f4c1ec56d7cb7d8ffe2e3b87f2cd2daee14cf7 (diff) | |
download | sonarqube-07b20316ee247a1694eb9191f985cb2de2d08b49.tar.gz sonarqube-07b20316ee247a1694eb9191f985cb2de2d08b49.zip |
SONAR-1973 Improve Resource Viewer
Diffstat (limited to 'sonar-server')
4 files changed, 21 insertions, 10 deletions
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 de7ec93b152..880786791c8 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 @@ -1,6 +1,7 @@ <div id="vId<%= violation.permanent_id -%>"> <% current_open_review = violation.get_open_review + false_positive = (current_open_review && current_open_review.review_type == "f-positive") %> <div class="violation"> @@ -25,6 +26,12 @@ duration=Date.today - violation.created_at.to_date %> <span class="violation_date"><%= duration==0 ? 'today' : "#{duration} days ago" -%></span> + + <% end %> + <% if false_positive %> + <%= image_tag("sep12.png") -%> + + False-Positive <% end %> <% if current_open_review && current_open_review.assignee %> <%= image_tag("sep12.png") -%> @@ -35,20 +42,18 @@ <% if current_user %> <span class="actions" id="vActions<%= violation.permanent_id.to_s -%>"> - <%= image_tag("sep12.png") -%> - <% if current_open_review %> + <% if current_open_review && !false_positive %> <%= link_to_remote "Close review", :url => { :controller => "reviews", :action => "close_review", :review_id => current_open_review.id, :rule_failure_permanent_id => violation.permanent_id }, :update => "vId" + violation.permanent_id.to_s -%> - <% if current_open_review.assignee == nil %> - <%= link_to_remote "Assign", + <%= link_to_remote (current_open_review.assignee == nil ? "Assign" : "Reassign"), :url => { :controller => "reviews", :action => "form_assign", :review_id => current_open_review.id, :rule_failure_permanent_id => violation.permanent_id }, - :update => "vActions" + violation.permanent_id.to_s -%> - - <% end %> + :update => "vActions" + violation.permanent_id.to_s, + :complete => "$('vActions" + violation.permanent_id.to_s + "').style.visibility='visible';$('assignee_id').focus();" -%> + <% end %> <% unless current_open_review %> <%= link_to_remote "Review", @@ -77,7 +82,8 @@ current_open_review.review_comments.each do |review_comment| %> <div class="comment"> - <h4><%= image_tag("reviews/comment.png") -%> <b><%= review_comment.user.name -%></b> on <%= l review_comment.created_at -%> + <% duration=Date.today - review_comment.created_at.to_date %> + <h4><%= image_tag("reviews/comment.png") -%> <b><%= review_comment.user.name -%></b> (<%= duration==0 ? 'today' : "#{duration} days ago" -%>) <% if review_comment == last_comment && current_user && current_user.id == review_comment.user.id %> <span class="actions"> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form.html.erb index e9ac1210093..494bc2974fc 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form.html.erb @@ -3,7 +3,7 @@ <%= f.hidden_field :review_type -%> <% if @review.review_type == "f-positive" %> - <b>Reason for flagging this violation as a false-positive:</b> + <b>Why is it a false-positive ?</b> <% end %> <%= text_area :review_comment, :review_text, :id => "reviewText", :rows => 8, diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_assign.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_assign.html.erb index 575c2f8aecc..4c53bb70131 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_assign.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_assign.html.erb @@ -1,4 +1,6 @@ -<% form_tag do %> +<%= image_tag("sep12.png") -%> + +<% form_tag :html => {:style => "display:inline"} do %> <%= hidden_field_tag :review_id, @review_id -%> <%= select_tag "assignee_id", options_for_select(@user_options, current_user.id.to_s) %> diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index 0d13ed516c0..9acfbd11d19 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -687,6 +687,9 @@ ul.operations li img { .sources2 div.violation:hover .actions{ visibility: visible; } +.sources2 div.violation .actions form { + display: inline; +} .sources2 div.vtitle{ background-color:#E4ECF3; margin:0; |