diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-26 14:21:21 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-26 14:21:21 +0200 |
commit | 97a58214d83c500121ff2e9e5ddd98730e4e48fd (patch) | |
tree | ee8e063dba14302a3222e2317011cf15b37749ea | |
parent | e5d8c474f9e3eb542a6a06e95a1ff06a84cea022 (diff) | |
download | sonarqube-97a58214d83c500121ff2e9e5ddd98730e4e48fd.tar.gz sonarqube-97a58214d83c500121ff2e9e5ddd98730e4e48fd.zip |
SONAR-2734 Provide a new "Deletion" service for each project
-rw-r--r-- | plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties | 1 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb | 10 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb | 3 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/project/deletion.html.erb (renamed from sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_delete_project.html.erb) | 1 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/project/settings.html.erb | 10 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_plugins.html.erb | 4 |
6 files changed, 20 insertions, 9 deletions
diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index 97560a509c0..4fa26ccaed7 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -280,6 +280,7 @@ project_roles.page=Project Roles project_settings.page=Settings project_links.page=Links project_exclusions.page=Exclusions +project_deletion.page=Deletion quality_profiles.page=Quality Profiles reviews.page=Reviews settings.page=General Settings 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 fe22aa979cd..127e6816f68 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 @@ -27,6 +27,16 @@ class ProjectController < ApplicationController redirect_to :overwrite_params => {:controller => :dashboard, :action => 'index'} end + def deletion + @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 delete if params[:id] @project = Project.by_key(params[:id]) 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 587c367f4ca..d90df8671ef 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 @@ -63,6 +63,9 @@ <% 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 %> + <% if (@project.project?) %> + <li class="<%= 'selected' if request.request_uri.include?('/project/deletion') -%>"><a href="<%= ApplicationController.root_context -%>/project/deletion/<%= @project.id -%>"><%= message('project_deletion.page') -%></a></li> + <% end %> <% end %> <% elsif selected_section==Navigation::SECTION_CONFIGURATION %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_delete_project.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/deletion.html.erb index 282a23c7627..a145f9eb4db 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_delete_project.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/deletion.html.erb @@ -1,5 +1,6 @@ <% if @snapshot.root? %> <h1>Delete project</h1> +<br/> <div class="yui-g widget" id="widget_delete_project"> <div class="warning"> This operation can not be undone. 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 c361a478aeb..cb5e508f23b 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,9 +1,9 @@ <div name="settings"> -<%= render :partial => 'project/settings/plugins' %> -<% if @project.project? %> -<br/> -<%= render :partial => 'project/settings/delete_project' %> -<% end %> + <h1 class="marginbottom10">Settings</h1> + + <div class="yui-g widget" id="widget_plugins"> + <%= render :partial => 'settings/plugins', :locals => {:project=>@project} %> + </div> </div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_plugins.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_plugins.html.erb deleted file mode 100644 index 7582ee2d3d4..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/settings/_plugins.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<h1 class="marginbottom10">Settings</h1> -<div class="yui-g widget" id="widget_plugins"> -<%= render :partial => 'settings/plugins', :locals => {:project=>@project} %> -</div>
\ No newline at end of file |