From: Fabrice Bellingard Date: Mon, 30 Jan 2012 14:14:53 +0000 (+0100) Subject: SONAR-3104 Improve the usability of the project 'History' X-Git-Tag: 2.14~219 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fa1f078c8e5e8130a6385ded5e66c7ecf6dca827;p=sonarqube.git SONAR-3104 Improve the usability of the project 'History' => Remove the ability to add & edit event categories (admin page removal) --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/event_categories_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/event_categories_controller.rb deleted file mode 100644 index e456620e7b0..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/event_categories_controller.rb +++ /dev/null @@ -1,65 +0,0 @@ -# -# Sonar, entreprise quality control tool. -# Copyright (C) 2008-2012 SonarSource -# mailto:contact AT sonarsource DOT com -# -# Sonar is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# Sonar is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with Sonar; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 -# -class EventCategoriesController < ApplicationController - - before_filter :admin_required - - verify :method => :post, :only => [ :save, :delete ], :redirect_to => { :action => :index } - - SECTION=Navigation::SECTION_CONFIGURATION - - def index - @categories=EventCategory.categories(true).sort - if params['name'] - @category=EventCategory.category(params['name']) - else - @category=EventCategory.new() - end - end - - def save - category=EventCategory.new(params['name'], params['description']) - - if params[:previous_name]!=category.name - errors=category.rename(params[:previous_name]) - else - errors=category.save - end - - if errors.empty? - flash[:notice]='Category saved.' - else - flash[:error]=errors.join('
') - end - redirect_to :action => 'index' - end - - def delete - if params['name'] - category=EventCategory.category(params['name']) - if category - category.delete - flash[:notice]='Category deleted.' - end - end - redirect_to :action => 'index' - end - -end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/event_categories/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/event_categories/index.html.erb deleted file mode 100644 index c2224d3ccf2..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/event_categories/index.html.erb +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - -
- - - - - - - - - - <% @categories.each do |category| %> - - - - - - - <% end %> - -
NameDescriptionOperations
<%= category.name %><%= category.description %> - <% if category.editable? %> -
- <% end %> -
- <% if category.editable? %> -
- <% end %> -
- -
- - - - - - - - - - - - - - -
- Name:
-
- Ex. : UAT -
- Description:
-
- Ex. : Start of User Acceptance Tests phase -
- <% if @category.nil? or @category.name.blank? %> - <%= submit_tag 'Create' %> - <% else %> - - <%= submit_tag "Update #{@category.name}" %> - cancel - <% end %> -
-
\ No newline at end of file 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 5e99800c99e..92bdd4e0d13 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 @@ -108,8 +108,6 @@ <%= message('my_profile.page') -%> <% end %> <% if is_admin? %> -
  • - <%= message('event_categories.page') -%>
  • <%= message('manual_metrics.page') -%>