From: Fabrice Bellingard Date: Tue, 26 Apr 2011 13:37:57 +0000 (+0200) Subject: SONAR-1973 Rework action link positions X-Git-Tag: 2.8~122 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4cb4cd79d731e41177505d6f339ecbbf7dea3332;p=sonarqube.git SONAR-1973 Rework action link positions --- 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 a6adaa5e811..6dd08dd9fb6 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 @@ -35,13 +35,21 @@ <% if current_user %> <%= image_tag("sep12.png") -%> -   + <% if violation.review %> +   <%= link_to_remote (violation.review && violation.review.assignee_id ? "Reassign" : "Assign"), :url => { :controller => "reviews", :action => "violation_assign_form", :violation_id => violation.id}, :update => "vActions" + violation.id.to_s, :complete => "$('vActions" + violation.id.to_s + "').show();$('assignee_id').focus();" -%> + <% else %> +   + <%= link_to_remote "Review", + :url => { :controller => "reviews", :action => "violation_comment_form", :id => violation.id }, + :update => "reviewForm" + violation.id.to_s, + :complete => "$('vActions#{violation.id}').hide();$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus()" -%> + <% end %> +   - <%= link_to_remote (violation.false_positive? ? "Unflag false-positive" : "Flag as false-positive"), :url => { :controller => "reviews", :action => "violation_false_positive_form", :id => violation.id, :false_positive => !violation.false_positive? }, :update => "reviewForm" + violation.id.to_s, @@ -97,7 +105,7 @@ -<% if current_user %> +<% if current_user && violation.review %>
<%= link_to_remote "Add comment", :url => { :controller => "reviews", :action => "violation_comment_form", :id => violation.id }, diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb index 80a5c613d14..f9b6a8cd35a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb @@ -30,7 +30,7 @@ Created by: - <%= h(review.user.name) -%> at <%= l(review.created_at) -%> + <%= h(review.user.name) -%> on <%= l(review.created_at, :format => :long) -%> <% if review.rule %>