]> source.dussan.org Git - sonarqube.git/commitdiff
Sort properties by name
authorDavid Gageot <david@gageot.net>
Fri, 5 Oct 2012 15:11:39 +0000 (17:11 +0200)
committerDavid Gageot <david@gageot.net>
Fri, 5 Oct 2012 15:18:44 +0000 (17:18 +0200)
sonar-server/src/main/webapp/WEB-INF/app/helpers/settings_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_settings.html.erb

index 857026a8042df21aa84204ef779722545393b9ea..1b7c36b12e85722c52c4936c18dc108a67924c92 100644 (file)
@@ -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
index b7713ed97fb1c139e2ebbacf77b3cb7befa197e2..167143441eceba5a146c52c0d1200728543e149f 100644 (file)
@@ -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>
index db82d07cee750d2af3d2fe8e3bc7316f2ac50f95..46e7c6ea3d17a39398544c581c9132227aa57d6d 100644 (file)
@@ -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>