aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-12-21 20:26:19 +0000
committerGodin <mandrikov@gmail.com>2010-12-21 20:26:19 +0000
commit58886ab179adcc661b8de890427f29fc6e9dc6c7 (patch)
treecf6dcc0a449907044f6e148d8c3db655a992320b
parente0907c5e8d41609bf0cdd237743075e4a1a57ee3 (diff)
downloadsonarqube-58886ab179adcc661b8de890427f29fc6e9dc6c7.tar.gz
sonarqube-58886ab179adcc661b8de890427f29fc6e9dc6c7.zip
SONAR-2048: Move inheritance settings to separate tab
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb14
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_tabs.html.erb3
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb14
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb10
5 files changed, 29 insertions, 14 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 4fdd7bd2380..dbc44d54107 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
@@ -23,7 +23,7 @@ class ProfilesController < ApplicationController
verify :method => :post, :only => ['create', 'delete', 'copy', 'set_as_default', 'restore', 'set_projects', 'rename'], :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' ]
+ before_filter :admin_required, :except => [ 'index', 'show', 'projects', 'permalinks', 'export', 'backup', 'inheritance' ]
#
#
@@ -31,7 +31,7 @@ class ProfilesController < ApplicationController
#
#
def index
- @profiles = Profile.find(:all, :order => 'name')
+ @profiles = Profile.find(:all, :order => 'name')
end
@@ -184,6 +184,16 @@ class ProfilesController < ApplicationController
send_data(result, :type => java_facade.getProfileExporterMimeType(exporter_key), :disposition => 'inline')
end
+ #
+ #
+ # GET /profiles/inheritance?id=<profile id>
+ #
+ #
+ def inheritance
+ @profile = Profile.find(params[:id])
+ @select_parent = [['', nil]] + Profile.find(:all).collect { |profile| [profile.name, profile.name] }.sort
+ end
+
#
#
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 fbb53a18eeb..0dd68d535ff 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
@@ -55,8 +55,6 @@ class RulesConfigurationController < ApplicationController
@select_priority = ANY_SELECTION + RULE_PRIORITIES
@select_status = [['Any',''], ["Active", STATUS_ACTIVE], ["Inactive", STATUS_INACTIVE]]
- @select_parent = [['', nil]] + RulesProfile.find(:all).collect { |profile| [profile.name, profile.name] }.sort
-
@rules = Rule.search(java_facade, {
:profile => @profile, :status => @status, :priorities => @priorities,
:plugins => @plugins, :searchtext => @searchtext, :include_parameters => true, :language => @profile.language})
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_tabs.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_tabs.html.erb
index abb5e584826..fb9d6f7db4b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_tabs.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_tabs.html.erb
@@ -15,6 +15,9 @@
<li>
<a href="<%= url_for :controller => 'profiles', :action => 'permalinks', :id => @profile.id -%>" <%= "class='selected'" if selected_tab=='Permalinks' -%>>Permalinks</a>
</li>
+ <li>
+ <a href="<%= url_for :controller => 'profiles', :action => 'inheritance', :id => @profile.id -%>" <%= "class='selected'" if selected_tab=='Inheritance' -%>>Inheritance</a>
+ </li>
<% if new_tab %>
<li>
<a href="#" class='selected'><%= new_tab -%></a>
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
new file mode 100644
index 00000000000..4bf37458890
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb
@@ -0,0 +1,14 @@
+<h1 class="marginbottom10"><%= link_to 'Quality profiles', :controller => 'profiles', :action => 'index' -%> / <%= h @profile.language -%> / <%= h @profile.name %></h1>
+<%= render :partial => 'profiles/tabs', :locals => {:selected_tab=>'Inheritance'} %>
+
+<div class="tabs-panel marginbottom10 ">
+
+<% if !@profile.provided? %>
+ <% form_tag({:action => 'change_parent'}, {:method => 'post'}) do %>
+ <%= hidden_field_tag "id", @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 %>
+<% end %>
+
+</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb
index a68fc7968d0..64e9e11abc9 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb
@@ -68,16 +68,6 @@
<% end %>
</div>
<div class="line-block marginbottom10">
- <div>
- <% if !@profile.provided? %>
- <% form_tag({:action => 'change_parent'}, {:method => 'post'}) do %>
- <%= hidden_field_tag "id", @id %>
- Parent profile: <%= select_tag "parent_name", options_for_select(@select_parent, @profile.parent_name), :disabled => !enable_modification %>
- <%= submit_tag "Change", :id => 'submit_parent', :disabled => !enable_modification %>
- <% end %>
- <% end %>
- </div>
-
<ul style="float: right" class="horizontal">
<li class="marginleft10">
<div class="csv">