diff options
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb | 7 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb index 3e815005411..6744ae13f21 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb @@ -45,15 +45,16 @@ module PropertiesHelper when PropertyType::TYPE_TEXT cols = options[:size] || nil - html_class = options[:size].nil? ? ' width100' : '' + html_class = cols.nil? ? ' width100' : '' text_area_tag name, value, {:class => html_class, :rows => '5', :cols => cols}.update(html_options) when PropertyType::TYPE_PASSWORD password_field_tag name, value, {:size => options[:size] || 25}.update(html_options) when PropertyType::TYPE_BOOLEAN - if !options[:default].blank? - select_options = "<option value='' #{ 'selected' if value.blank? }>#{ message('default') }</option>" + if !options[:default].blank? || screen == SCREEN_SETTINGS + default_value = options[:default].blank? ? '' : message('default') + select_options = "<option value='' #{ 'selected' if value.blank? }>#{ default_value }</option>" select_options += "<option value='true' #{ 'selected' if value=='true' }>#{ message('true') }</option>" select_options += "<option value='false' #{ 'selected' if value=='false' }>#{ message('false') }</option>" select_tag name, select_options, html_options diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb index ac671bf6915..af46cf40082 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb @@ -1,5 +1,5 @@ <% options = {:id => id} - options[:cols] = (defined? size) ? size : 50 + options[:size] = (defined? size) ? size : nil %> -<%= property_input_field(name, PropertyType::TYPE_TEXT, value, PropertiesHelper::SCREEN_SETTINGS, {:id => id, :cols => (defined? size) ? size : nil}) %> +<%= property_input_field(name, PropertyType::TYPE_TEXT, value, PropertiesHelper::SCREEN_SETTINGS, options) %> |