From: simonbrandhof Date: Wed, 22 Dec 2010 15:07:00 +0000 (+0000) Subject: SONAR-1722 rename the Inheritance Tree tab + add missing image X-Git-Tag: 2.6~243 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0c585e0f026f659792939b4c5b82aa506b5a7cba;p=sonarqube.git SONAR-1722 rename the Inheritance Tree tab + add missing image --- 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 ea222e8aa56..fcd05e004fd 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 @@ -24,7 +24,7 @@ class ProfilesController < ApplicationController verify :method => :post, :only => ['create', 'delete', 'copy', 'set_as_default', 'restore', 'set_projects', 'rename', 'change_parent'], :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', 'hierarchy' ] + before_filter :admin_required, :except => [ 'index', 'show', 'projects', 'permalinks', 'export', 'backup', 'inheritance' ] # # @@ -187,10 +187,10 @@ class ProfilesController < ApplicationController # # - # GET /profiles/hierarchy?id= + # GET /profiles/inheritance?id= # # - def hierarchy + def inheritance @profile = Profile.find(params[:id]) profiles=Profile.find(:all, :conditions => ['language=? and id<>? and (parent_name is null or parent_name<>?)', @profile.language, @profile.id, @profile.name], :order => 'name') @@ -212,7 +212,7 @@ class ProfilesController < ApplicationController messages = java_facade.changeParentProfile(id, parent_name) end flash_validation_messages(messages) - redirect_to :action => 'hierarchy', :id => id + redirect_to :action => 'inheritance', :id => id end 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 c1dad1849de..47ccff6a5f5 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 @@ -16,7 +16,7 @@ >Permalinks
  • - >Hierarchy + >Inheritance Tree
  • <% if new_tab %>
  • diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/hierarchy.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/hierarchy.html.erb deleted file mode 100644 index 41c0df853a0..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/hierarchy.html.erb +++ /dev/null @@ -1,49 +0,0 @@ -

    <%= link_to 'Quality profiles', :controller => 'profiles', :action => 'index' -%> / <%= h @profile.language -%> / <%= h @profile.name %>

    -<%= render :partial => 'profiles/tabs', :locals => {:selected_tab=>'Hierarchy'} %> - -
    - - - - - <% if is_admin? %> - - <% end %> - -
    -
    - <% @profile.ancestors.reverse.each do |parent| %> - <%= parent.name -%> (<%= parent.active_rules.size -%> rules)
    - <%= image_tag 'blue-up.png' -%>
    - <% end %> - - <%= @profile.name -%> (<%= @profile.active_rules.size -%> rules)
    - - <% if @profile.children.size>0 %> - <%= image_tag 'blue-up.png' -%>
    - <% @profile.children.each_with_index do |child,index| %> - <%= ', ' if index>0 -%> - <%= child.name -%> (<%= child.active_rules.size -%> rules) - <% end %> -
    <%= image_tag 'blue-up.png' -%>
    - ... - <% end %> -
    -
    -
    - <% if @profile.provided? %> -

    This profile can not be changed.

    - - <% else %> -

    Set parent:

    -

    Inherit rules configuration from the profile:

    - <% form_tag({:action => 'change_parent'}, {:method => 'post'}) do %> - <%= hidden_field_tag "id", @profile.id %> - <%= select_tag "parent_name", options_for_select(@select_parent, @profile.parent_name) %> - <%= submit_tag "Change", :id => 'submit_parent'%> - <% end %> - <% 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 new file mode 100644 index 00000000000..7d3e1c04da9 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/inheritance.html.erb @@ -0,0 +1,49 @@ +

    <%= link_to 'Quality profiles', :controller => 'profiles', :action => 'index' -%> / <%= h @profile.language -%> / <%= h @profile.name %>

    +<%= render :partial => 'profiles/tabs', :locals => {:selected_tab=>'inheritance'} %> + +
    + + + + + <% if is_admin? %> + + <% end %> + +
    +
    + <% @profile.ancestors.reverse.each do |parent| %> + <%= parent.name -%> (<%= parent.active_rules.size -%> rules)
    + <%= image_tag 'blue-up.png' -%>
    + <% end %> + + <%= @profile.name -%> (<%= @profile.active_rules.size -%> rules)
    + + <% if @profile.children.size>0 %> + <%= image_tag 'blue-up.png' -%>
    + <% @profile.children.each_with_index do |child,index| %> + <%= ', ' if index>0 -%> + <%= child.name -%> (<%= child.active_rules.size -%> rules) + <% end %> +
    <%= image_tag 'blue-up.png' -%>
    + ... + <% end %> +
    +
    +
    + <% if @profile.provided? %> +

    This profile can not be changed.

    + + <% else %> +

    Set parent:

    +

    Inherit rules configuration from the profile:

    + <% form_tag({:action => 'change_parent'}, {:method => 'post'}) do %> + <%= hidden_field_tag "id", @profile.id %> + <%= select_tag "parent_name", options_for_select(@select_parent, @profile.parent_name) %> + <%= submit_tag "Change", :id => 'submit_parent'%> + <% end %> + <% end %> +
    +
    + +
    diff --git a/sonar-server/src/main/webapp/images/up-blue-24.png b/sonar-server/src/main/webapp/images/up-blue-24.png new file mode 100644 index 00000000000..a3507b3c058 Binary files /dev/null and b/sonar-server/src/main/webapp/images/up-blue-24.png differ