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' ]
#
#
#
#
def index
- @profiles = Profile.find(:all, :order => 'name')
+ @profiles = Profile.find(:all, :order => 'name')
end
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
+
#
#
@select_priority = ANY_SELECTION + RULE_PRIORITIES\r
@select_status = [['Any',''], ["Active", STATUS_ACTIVE], ["Inactive", STATUS_INACTIVE]]\r
- @select_parent = [['', nil]] + RulesProfile.find(:all).collect { |profile| [profile.name, profile.name] }.sort
-
@rules = Rule.search(java_facade, {\r
:profile => @profile, :status => @status, :priorities => @priorities,\r
:plugins => @plugins, :searchtext => @searchtext, :include_parameters => true, :language => @profile.language})\r
<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>
--- /dev/null
+<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>
<% 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">