]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2048: Show inherited profiles
authorGodin <mandrikov@gmail.com>
Tue, 21 Dec 2010 21:20:05 +0000 (21:20 +0000)
committerGodin <mandrikov@gmail.com>
Tue, 21 Dec 2010 21:20:05 +0000 (21:20 +0000)
sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb

index d0bea4321890c960097fd10d313cdfa63398f56c..3ce33ce9463f46e302ab45e7394cc78f88836670 100644 (file)
@@ -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
 
index dcd2c770ce36e13fe417cfe15a744dadc4469bb4..0d34194ff368100eee153fab39467f01a4145fcd 100644 (file)
@@ -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>