From 3afdc2f602cee595a7b3cccf47975cb23aaeb6d1 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Thu, 28 Apr 2011 10:00:21 +0200 Subject: [PATCH] SONAR-1973, SONAR-2327 Fix issues based on Freddy's feedback --- .../WEB-INF/app/helpers/application_helper.rb | 6 +++--- .../WEB-INF/app/views/markdown/_help.html.erb | 16 ++++++++++++++++ .../app/views/resource/_violation.html.erb | 12 +++++++++--- .../app/views/reviews/_comment_form.html.erb | 17 +---------------- .../WEB-INF/app/views/reviews/_review.html.erb | 2 +- .../reviews/_violation_comment_form.html.erb | 17 +---------------- 6 files changed, 31 insertions(+), 39 deletions(-) create mode 100644 sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index af3bb857f53..ccc33e692ff 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -315,13 +315,13 @@ module ApplicationHelper period_index=nil if period_index && period_index<=0 if resource.display_dashboard? if options[:dashboard] - link_to(name || resource.name, {:overwrite_params => {:controller => 'dashboard', :action => 'index', :id => (resource.copy_resource_id||resource.id), :period => period_index}}, :title => options[:title]) + link_to(name || resource.name, {:overwrite_params => {:controller => 'dashboard', :action => 'index', :id => (resource.copy_resource_id||resource.id), :period => period_index, :tab => options[:tab]}}, :title => options[:title]) else # stay on the same page (for example components) - link_to(name || resource.name, {:overwrite_params => {:id => (resource.copy_resource_id||resource.id), :period => period_index}}, :title => options[:title]) + link_to(name || resource.name, {:overwrite_params => {:id => (resource.copy_resource_id||resource.id), :period => period_index, :tab => options[:tab]}}, :title => options[:title]) end else - link_to(name || resource.name, {:controller => 'resource', :action => 'index', :id => resource.id, :period => period_index}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title]) + link_to(name || resource.name, {:controller => 'resource', :action => 'index', :id => resource.id, :period => period_index, :tab => options[:tab]}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title]) end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb new file mode 100644 index 00000000000..d116702f885 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb @@ -0,0 +1,16 @@ +

Help Tips

+ + + + + + + + + + + + + + +
*bold*bold
``code``code
* Bulleted point
\ 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 70e0c63094b..aa187b7b5be 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,19 @@ <% if current_user %> <%= image_tag("sep12.png") -%> - <% if violation.review %> + <% + if violation.review + unless violation.false_positive? + %>   <%= 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 %> + <% + end + else + %>   <%= link_to_remote "Review", :url => { :controller => "reviews", :action => "violation_comment_form", :id => violation.id }, @@ -50,7 +56,7 @@ <% end %>   - <%= link_to_remote (violation.false_positive? ? "Unflag false-positive" : "Flag as false-positive"), + <%= link_to_remote (violation.false_positive? ? "Unflag as 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, :complete => "$('vActions" + violation.id.to_s + "').hide();$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();" -%> 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 6cb2a2bd58e..58beeb5ac65 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 @@ -17,22 +17,7 @@ -

Help Tips

- - - - - - - - - - - - - - -
*bold*bold
''code''code
* Bulleted point
+ <%= render :partial => 'markdown/help' -%> 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 aa13895b6ed..2cb37687ff4 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 @@ -71,7 +71,7 @@ <%= qualifier_icon(@review.resource) -%> <% if !review.on_project? %> <%= @review.project.long_name -%> <%= image_tag 'sep12.png' -%> <% end %> - <%= link_to_resource(review.resource, review.resource.long_name) %> + <%= link_to_resource(review.resource, review.resource.long_name, { :tab => :violations } ) %> 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 daa7600ffcf..a080d8b0e5e 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 @@ -22,22 +22,7 @@ -

Help Tips

- - - - - - - - - - - - - - -
*bold*bold
''code''code
* Bulleted point
+ <%= render :partial => 'markdown/help' -%> -- 2.39.5