From 07b20316ee247a1694eb9191f985cb2de2d08b49 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Wed, 20 Apr 2011 18:49:33 +0200 Subject: [PATCH] SONAR-1973 Improve Resource Viewer --- .../app/views/resource/_violation.html.erb | 22 ++++++++++++------- .../WEB-INF/app/views/reviews/_form.html.erb | 2 +- .../app/views/reviews/_form_assign.html.erb | 4 +++- .../src/main/webapp/stylesheets/style.css | 3 +++ 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 @@
<% current_open_review = violation.get_open_review + false_positive = (current_open_review && current_open_review.review_type == "f-positive") %>
@@ -25,6 +26,12 @@ duration=Date.today - violation.created_at.to_date %> <%= duration==0 ? 'today' : "#{duration} days ago" -%> +    + <% 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 %> -    <%= 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| %>
-

<%= image_tag("reviews/comment.png") -%>  <%= review_comment.user.name -%> on <%= l review_comment.created_at -%> + <% duration=Date.today - review_comment.created_at.to_date %> +

<%= image_tag("reviews/comment.png") -%>  <%= review_comment.user.name -%> (<%= duration==0 ? 'today' : "#{duration} days ago" -%>) <% if review_comment == last_comment && current_user && current_user.id == review_comment.user.id %>    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" %> - Reason for flagging this violation as a false-positive: + Why is it a false-positive ? <% 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; -- 2.39.5