aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-08-18 12:03:03 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-08-18 12:03:03 +0200
commit6ec8c8da9567b39a3deb700afa913f2132f87180 (patch)
tree6141a91ea4617d25e537304ceabc8ddd916fc909
parent8a492ff267bccae3653331918f6fc3d3a11737dc (diff)
downloadsonarqube-6ec8c8da9567b39a3deb700afa913f2132f87180.tar.gz
sonarqube-6ec8c8da9567b39a3deb700afa913f2132f87180.zip
SONAR-2713 default category is 'General'
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb2
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]<<property
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb
index b56c661fdf2..5263a9b9bf3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb
@@ -59,7 +59,7 @@
</td>
<td class="column">
- <% if @category
+ <% if @category && @properties_per_category[@category] && !@properties_per_category[@category].empty?
category_name = message("property.category.#{@category}", :default => @category)
%>