diff options
author | Godin <mandrikov@gmail.com> | 2010-12-21 21:20:05 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-12-21 21:20:05 +0000 |
commit | 13501e0d503a0e258744d79255cc2a8cbd2adffe (patch) | |
tree | 9ed3414cf0284da8c83c6b57c32dff218b488e4f /sonar-server/src | |
parent | 748efe41d5d2a9f1f99374c9949b49a2c4c88a4d (diff) | |
download | sonarqube-13501e0d503a0e258744d79255cc2a8cbd2adffe.tar.gz sonarqube-13501e0d503a0e258744d79255cc2a8cbd2adffe.zip |
SONAR-2048: Show inherited profiles
Diffstat (limited to 'sonar-server/src')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb | 3 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb | 7 |
2 files changed, 10 insertions, 0 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 d0bea432189..3ce33ce9463 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 @@ -192,6 +192,9 @@ class ProfilesController < ApplicationController # def inheritance @profile = Profile.find(params[:id]) + @child_profiles = Profile.find(:all, + :conditions => {:language => @profile.language, :parent_name => @profile.name}, + :order => 'name') @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/views/profiles/inheritance.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb index dcd2c770ce3..0d34194ff36 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 @@ -9,6 +9,13 @@ 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 %> + + <% if @child_profiles.size > 0 %> + Inherited profiles:<br/> + <% @child_profiles.each do |child| %> + <a href="<%= url_for :controller => 'profiles', :action => 'inheritance', :id => child.id -%>"><%= child.name %></a><br/> + <% end %> + <% end %> <% end %> </div> |