From 8e4f1f764c4da0bf2a48aa76a54c8b3c8b6bf260 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 18 Dec 2012 23:31:19 +0100 Subject: [PATCH] Ability to share copied filter --- .../WEB-INF/app/controllers/measures_controller.rb | 11 +++++------ .../WEB-INF/app/views/measures/_copy_form.html.erb | 8 ++++++-- .../WEB-INF/app/views/measures/_edit_form.html.erb | 6 +++--- .../webapp/WEB-INF/app/views/measures/search.html.erb | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb index 79417be5417..3b5da35de38 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb @@ -161,12 +161,11 @@ class MeasuresController < ApplicationController source = find_filter(params[:id]) target = MeasureFilter.new - target.name = params[:name] - target.description = params[:description] - target.user_id = current_user.id - target.shared = source.shared - target.data = source.data - target.shared = false + target.name=params[:name] + target.description=params[:description] + target.user_id=current_user.id + target.shared=(params[:shared]=='true') + target.data=source.data if target.save current_user.favourited_measure_filters << target render :text => target.id.to_s, :status => 200 diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb index 89d14fa379c..019edbafc84 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_copy_form.html.erb @@ -13,13 +13,17 @@
- +
- +
+
+ + /> +
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb index 14af4202db5..d9046be651b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb @@ -9,15 +9,15 @@

<%= h msg -%>

<% end %>
- +
- +
- + />
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb index 4e116fb0763..6b3b340579c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb @@ -39,7 +39,7 @@ <% end %> <% unless @filter.id %>
  • - <%= message('save_as') -%> + <%= message('save_as') -%>
  • <% end %> <% end %> -- 2.39.5