From: Fabrice Bellingard Date: Mon, 2 May 2011 12:00:59 +0000 (+0200) Subject: SONAR-1973, SONAR-2327 Fix minor UI issues X-Git-Tag: 2.8~65 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=42268bc95b07757f4821511342ccbd14084a0ef3;p=sonarqube.git SONAR-1973, SONAR-2327 Fix minor UI issues --- 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 71065ec421f..94eadb0f8b2 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 @@ -43,7 +43,7 @@ <%= 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();" -%> + :complete => "$('vActions" + violation.id.to_s + "').show();$('commentActions" + violation.id.to_s + "').hide();$('assignee_id').focus();" -%> <% end else @@ -52,14 +52,14 @@ <%= 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()" -%> + :complete => "$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();$('vActions#{violation.id}').hide();" -%> <% end %>   <%= link_to_remote (violation.switched_off? ? "Unflag as false-positive" : "Flag as false-positive"), :url => { :controller => "reviews", :action => "violation_false_positive_form", :id => violation.id, :false_positive => !violation.switched_off? }, :update => "reviewForm" + violation.id.to_s, - :complete => "$('vActions" + violation.id.to_s + "').hide();$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();" -%> + :complete => "$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();$('vActions" + violation.id.to_s + "').hide();$('commentActions" + violation.id.to_s + "').hide();" -%> <% end %> @@ -93,7 +93,7 @@ <%= link_to_remote "Edit", :url => { :controller => "reviews", :action => "violation_comment_form", :comment_id => review_comment.id, :id => violation.id }, :update => "lastComment" + violation.id.to_s, - :complete => "$('reviewForm#{violation.id}').hide();$('vActions#{violation.id}').hide();$('commentAction#{violation.id}').hide();$('commentText#{violation.id}').focus();" -%> + :complete => "$('vActions#{violation.id}').hide();$('commentActions#{violation.id}').hide();$('commentText#{violation.id}').focus();" -%> <% unless comment_index == 0 %>   <%= link_to_remote "Delete", diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_comment_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_comment_form.html.erb index 58beeb5ac65..2a7723c8324 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_comment_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_comment_form.html.erb @@ -13,6 +13,7 @@
<%= submit_to_remote "submit_btn", button, :url => { :action => 'save_comment'}, :html => { :id => "submit_btn", :disabled => "true" }, :update => 'review' -%> +   <%= link_to_remote 'Cancel', :url => {:action => 'show', :id => params[:id]}, :update => 'review' -%> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_false_positive_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_false_positive_form.html.erb index 6cc844cb38e..98f329bd088 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_false_positive_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_false_positive_form.html.erb @@ -3,5 +3,6 @@

Why is it a false-positive ?

<%= submit_to_remote "submit_btn", "Flag as false-positive", :url => { :action => 'flag_as_false_positive' }, :html => { :id => "submit_btn", :disabled => "true" }, :update => 'review' -%> +   <%= link_to_remote 'Cancel', :url => {:action => 'show', :id => params[:id]}, :update => 'review' -%> 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 9b69baadc63..be8cccb920f 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 @@ -11,13 +11,13 @@ <%= link_to_remote (review.assignee_id ? "Reassign" : "Assign"), :url => { :controller => "reviews", :action => "assign_form", :review_id => review.id}, :update => "assignForm", - :complete => "$('rActions').hide(); $('commentAction').hide(); $('assignee_id').focus();" -%> + :complete => "$('rActions').hide(); $('editActions').hide(); $('assignee_id').focus();" -%>   <%= link_to_remote ("Flag as false-positive"), :url => { :controller => "reviews", :action => "false_positive_form", :id => review.id }, :update => "reviewForm", - :complete => "$('rActions').hide(); $('commentAction').hide(); $('reviewForm').show();$('commentText').focus();" -%> + :complete => "$('reviewForm').show(); $('rActions').hide(); $('editActions').hide(); $('commentText').focus();" -%> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb index a080d8b0e5e..d045ad90c28 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb @@ -13,6 +13,7 @@
<%= submit_to_remote "submit_btn", button, :url => { :action => 'violation_save_comment'}, :html => { :id => "submit_btn", :disabled => "true" }, :update => 'vId'+params[:id] -%> +   <%= link_to_remote 'Cancel', :url => {:action => 'display_violation', :id => params[:id]}, :update => 'vId' + params[:id] -%> <% if @violation.review.nil? || @violation.review.comments.size==0 %>