From 13501e0d503a0e258744d79255cc2a8cbd2adffe Mon Sep 17 00:00:00 2001 From: Godin Date: Tue, 21 Dec 2010 21:20:05 +0000 Subject: SONAR-2048: Show inherited profiles --- .../src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb | 3 +++ .../main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb | 7 +++++++ 2 files changed, 10 insertions(+) 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:
+ <% @child_profiles.each do |child| %> + <%= child.name %>
+ <% end %> + <% end %> <% end %> -- cgit v1.2.3