diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-24 15:00:07 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-24 15:00:07 +0200 |
commit | 89391aba6ca7a49a24fd402f92d5875d51138397 (patch) | |
tree | 448f190d4486c3b867a1362cd38f685e8484894b /sonar-server/src | |
parent | 7a4e303178603bd4cf718154829d88cccd34aaa0 (diff) | |
download | sonarqube-89391aba6ca7a49a24fd402f92d5875d51138397.tar.gz sonarqube-89391aba6ca7a49a24fd402f92d5875d51138397.zip |
SONAR-2702 New "Exclusions" service in the "CONFIGURATION" section
Diffstat (limited to 'sonar-server/src')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb | 27 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb | 6 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/project/exclusions.html.erb (renamed from sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_exclusions.html.erb) | 1 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/project/links.html.erb (renamed from sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_links.html.erb) | 1 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/project/settings.html.erb | 4 |
5 files changed, 32 insertions, 7 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb index 1ad83db4518..fe22aa979cd 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb @@ -37,6 +37,16 @@ class ProjectController < ApplicationController redirect_to_default end + def links + @project=Project.by_key(params[:id]) + return access_denied unless is_admin?(@project) + + @snapshot=@project.last_snapshot + if !@project.project? + redirect_to :action => 'index', :id => params[:id] + end + end + def set_links project = Project.by_key(params[:project_id]) return access_denied unless is_admin?(project) @@ -60,9 +70,10 @@ class ProjectController < ApplicationController project.save! flash[:notice] = 'Links updated.' - redirect_to :action => 'settings', :id => project.id + redirect_to :action => 'links', :id => project.id end + def settings @project=Project.by_key(params[:id]) return access_denied unless is_admin?(@project) @@ -102,6 +113,16 @@ class ProjectController < ApplicationController end + def exclusions + @project=Project.by_key(params[:id]) + return access_denied unless is_admin?(@project) + + @snapshot=@project.last_snapshot + if !@project.project? && !@project.module? + redirect_to :action => 'index', :id => params[:id] + end + end + def set_exclusions @project = Project.find(params[:id]) return access_denied unless is_admin?(@project) @@ -114,7 +135,7 @@ class ProjectController < ApplicationController Property.set('sonar.exclusions', patterns.collect{|x| x.strip}.join(','), @project.id) end flash[:notice]='Filters added' - redirect_to :action => 'settings', :id => @project.id + redirect_to :action => 'exclusions', :id => @project.id end def delete_exclusions @@ -123,7 +144,7 @@ class ProjectController < ApplicationController Property.clear('sonar.exclusions', @project.id) flash[:notice]='Filters deleted' - redirect_to :action => 'settings', :id => @project.id + redirect_to :action => 'exclusions', :id => @project.id end protected diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index 871641fa03a..587c367f4ca 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -54,6 +54,12 @@ <% if (@project.project? || @project.module?) %> <li class="<%= 'selected' if request.request_uri.include?('/project/settings') -%>"><a href="<%= ApplicationController.root_context -%>/project/settings/<%= @project.id -%>"><%= message('project_settings.page') -%></a></li> <% end %> + <% if (@project.project? || @project.module?) %> + <li class="<%= 'selected' if request.request_uri.include?('/project/exclusions') -%>"><a href="<%= ApplicationController.root_context -%>/project/exclusions/<%= @project.id -%>"><%= message('project_exclusions.page') -%></a></li> + <% end %> + <% if (@project.project?) %> + <li class="<%= 'selected' if request.request_uri.include?('/project/links') -%>"><a href="<%= ApplicationController.root_context -%>/project/links/<%= @project.id -%>"><%= message('project_links.page') -%></a></li> + <% end %> <% if (@project.project? || @project.view? || @project.subview?) %> <li class="<%= 'selected' if request.request_uri.include?('/project_roles') -%>"><a href="<%= ApplicationController.root_context -%>/project_roles/index?resource=<%= @project.id -%>"><%= message('project_roles.page') -%></a></li> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_exclusions.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/exclusions.html.erb index b2208db0f2b..19161bb8b50 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_exclusions.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/exclusions.html.erb @@ -1,4 +1,5 @@ <h1>Exclude sources from code analysis</h1> +<br/> <div class="yui-g widget" id="widget_exclusions"> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_links.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/links.html.erb index 8f79d83807e..727687e91d9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_links.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/links.html.erb @@ -1,4 +1,5 @@ <h1>Project links</h1> +<br/> <div class="yui-g widget" id="widget_links"> <% form_for( 'set_links', :url => { :action => 'set_links', :project_id => @project.id } ) do |form| diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings.html.erb index 16f30eb7022..c361a478aeb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings.html.erb @@ -1,12 +1,8 @@ <div name="settings"> <%= render :partial => 'project/settings/plugins' %> -<br/> -<%= render :partial => 'project/settings/exclusions' %> <% if @project.project? %> <br/> -<%= render :partial => 'project/settings/links' %> -<br/> <%= render :partial => 'project/settings/delete_project' %> <% end %> |