From 7154795d71f1d293c5fb3c5673911f40bab05e01 Mon Sep 17 00:00:00 2001 From: Godin Date: Thu, 4 Nov 2010 11:26:13 +0000 Subject: [PATCH] SONAR-1794: Handle a new type of "text" property value in the Quality Profile service --- .../views/rules_configuration/_rule_param.html.erb | 12 ++++++++++-- .../app/views/rules_configuration/index.html.erb | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb index 9428a80b60a..c695a0218b7 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb @@ -16,8 +16,16 @@ <%= form_remote_tag :url => {:action => 'update_param', :id => active_param_id, :profile_id => profile.id, :param_id => parameter.id, :active_rule_id => active_rule_id}, :update => "param_#{parameter.id}", :loading => "$('param_loading_#{parameter.id}').show();" %> - /> - <% if active_rule && enable_modification %> + + <% span_id = "text_#{parameter.id}" %> + <% read_only = !active_rule || !enable_modification %> + <% textfield = text_field_tag parameter.id, param_value, :size => parameter.input_box_size, :name => "value", :disabled => read_only %> + <% textfield += link_to_function(image_tag("zoom.png"), "replaceTextField('#{span_id}', '#{parameter.id}')", :id => "toggle_text", :class => 'nolink') unless read_only %> + <% textarea = text_area_tag parameter.id, param_value, :size => "100x10", :name => "value", :disabled => read_only %> + <% textarea += "
" %> + <%= (param_value.length < 50) ? textfield : textarea %> + + <% if !read_only %> <%= submit_tag 'update' %> <% if active_parameter and active_parameter.errors.size>0 %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb index f1851192431..64534a0049c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb @@ -123,3 +123,10 @@ <% end %> + -- 2.39.5