aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-10-05 17:11:39 +0200
committerDavid Gageot <david@gageot.net>2012-10-05 17:18:44 +0200
commit3582904207a87f818846fbc7cce7c50d5194771f (patch)
tree252b8b579266d183afabef5a31f8a47c71572bd8
parent6832c22f97682db56ed6dd3506b5d62de56ae2d6 (diff)
downloadsonarqube-3582904207a87f818846fbc7cce7c50d5194771f.tar.gz
sonarqube-3582904207a87f818846fbc7cce7c50d5194771f.zip
Sort properties by name
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb2
3 files changed, 7 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb
index 857026a8042..1b7c36b12e8 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb
@@ -77,10 +77,14 @@ module SettingsHelper
property.getType()
end
- def by_name(categories)
+ def by_category_name(categories)
Api::Utils.insensitive_sort(categories) { |category| category_name(category) }
end
+ def by_property_name(properties)
+ Api::Utils.insensitive_sort(properties) { |property| property_name(property) }
+ end
+
def input_name(property)
name = "settings[#{h property.key}]"
if property.multi_values
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
index b7713ed97fb..167143441ec 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
@@ -14,7 +14,7 @@
</tr>
</thead>
<tbody>
- <% @definitions.each do |property| -%>
+ <% by_property_name(@definitions).each do |property| -%>
<tr class="property <%= cycle('even', 'odd', :name => 'properties') -%>">
<td style="padding: 10px" id="block_<%= property.key -%>">
<h3>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb
index db82d07cee7..46e7c6ea3d1 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb
@@ -11,7 +11,7 @@
</tr>
</thead>
<tbody>
- <% by_name(@categories).each do |category| -%>
+ <% by_category_name(@categories).each do |category| -%>
<tr id="select_<%= category -%>" class="select <%= cycle('even', 'odd', :name => 'category') -%> <%= 'selected' if @category==category -%>">
<td><%= link_to category_name(category), :category => category -%></td>
</tr>