From 6ec8c8da9567b39a3deb700afa913f2132f87180 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 18 Aug 2011 12:03:03 +0200 Subject: [PATCH] SONAR-2713 default category is 'General' --- .../webapp/WEB-INF/app/controllers/settings_controller.rb | 8 ++++---- .../webapp/WEB-INF/app/views/settings/_plugins.html.erb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb index a936793ac29..487456bd8e9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb @@ -25,7 +25,7 @@ class SettingsController < ApplicationController def index return access_denied unless is_admin? - load_properties() + load_properties(false) @category ||= 'General' end @@ -39,7 +39,7 @@ class SettingsController < ApplicationController resource_id=nil end - load_properties() + load_properties(true) if @category && @properties_per_category[@category] @properties_per_category[@category].each do |property| @@ -70,11 +70,11 @@ class SettingsController < ApplicationController private - def load_properties + def load_properties(all=true) @category=params[:category] @properties_per_category={} java_facade.getPluginsMetadata().each do |plugin| - java_facade.getPluginProperties(plugin).select { |property| property.global }.each do |property| + java_facade.getPluginProperties(plugin).select { |property| all || property.global }.each do |property| category = (property.category().present? ? property.category() : plugin.name()) @properties_per_category[category]||=[] @properties_per_category[category]< - <% if @category + <% if @category && @properties_per_category[@category] && !@properties_per_category[@category].empty? category_name = message("property.category.#{@category}", :default => @category) %> -- 2.39.5