aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-12-21 20:49:31 +0000
committerGodin <mandrikov@gmail.com>2010-12-21 20:49:31 +0000
commit748efe41d5d2a9f1f99374c9949b49a2c4c88a4d (patch)
tree4ab8dc776e91254ca24dce0ba36055c05656368d /sonar-server/src
parent58886ab179adcc661b8de890427f29fc6e9dc6c7 (diff)
downloadsonarqube-748efe41d5d2a9f1f99374c9949b49a2c4c88a4d.tar.gz
sonarqube-748efe41d5d2a9f1f99374c9949b49a2c4c88a4d.zip
SONAR-2048: Move inheritance settings to separate tab
Diffstat (limited to 'sonar-server/src')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb20
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb19
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb2
3 files changed, 21 insertions, 20 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
index dbc44d54107..d0bea432189 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
@@ -20,7 +20,8 @@
class ProfilesController < ApplicationController
SECTION=Navigation::SECTION_CONFIGURATION
- verify :method => :post, :only => ['create', 'delete', 'copy', 'set_as_default', 'restore', 'set_projects', 'rename'], :redirect_to => { :action => 'index' }
+ # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
+ verify :method => :post, :only => ['create', 'delete', 'copy', 'set_as_default', 'restore', 'set_projects', 'rename', 'change_parent'], :redirect_to => { :action => 'index' }
# the backup action is allow to non-admin users : see http://jira.codehaus.org/browse/SONAR-2039
before_filter :admin_required, :except => [ 'index', 'show', 'projects', 'permalinks', 'export', 'backup', 'inheritance' ]
@@ -197,6 +198,23 @@ class ProfilesController < ApplicationController
#
#
+ # POST /profiles/change_parent?id=<profile id>&parent_name=<parent profile name>
+ #
+ #
+ def change_parent
+ id = params[:id].to_i
+ parent_name = params[:parent_name]
+ if parent_name.blank?
+ java_facade.changeParentProfile(id, nil)
+ else
+ java_facade.changeParentProfile(id, parent_name)
+ end
+ redirect_to :action => 'inheritance', :id => id
+ end
+
+
+ #
+ #
# GET /profiles/permalinks?id=<profile id>
#
#
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
index 0dd68d535ff..163b5e29de1 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
@@ -29,7 +29,7 @@ class RulesConfigurationController < ApplicationController
RULE_PRIORITIES = Sonar::RulePriority.as_options.reverse
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
- verify :method => :post, :only => ['activate_rule', 'update_param', 'bulk_edit', 'create', 'update', 'delete', 'change_parent', 'revert_rule'], :redirect_to => { :action => 'index' }
+ verify :method => :post, :only => ['activate_rule', 'update_param', 'bulk_edit', 'create', 'update', 'delete', 'revert_rule'], :redirect_to => { :action => 'index' }
before_filter :admin_required, :except => [ 'index', 'export' ]
@@ -73,23 +73,6 @@ class RulesConfigurationController < ApplicationController
end
end
-
-
- #
- #
- # POST /rules_configuration/change_parent?id=<profile id>&parent_name=<parent profile name>
- #
- #
- def change_parent
- id = params[:id].to_i
- parent_name = params[:parent_name]
- if parent_name.blank?
- java_facade.changeParentProfile(id, nil)
- else
- java_facade.changeParentProfile(id, parent_name)
- end
- redirect_to :action => 'index', :id => params[:id]
- end
#
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb
index 4bf37458890..dcd2c770ce3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb
@@ -5,7 +5,7 @@
<% if !@profile.provided? %>
<% form_tag({:action => 'change_parent'}, {:method => 'post'}) do %>
- <%= hidden_field_tag "id", @id %>
+ <%= hidden_field_tag "id", @profile.id %>
Parent profile: <%= select_tag "parent_name", options_for_select(@select_parent, @profile.parent_name), :disabled => !is_admin? %>
<%= submit_tag "Change", :id => 'submit_parent', :disabled => !is_admin? %>
<% end %>