aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-11-04 11:26:13 +0000
committerGodin <mandrikov@gmail.com>2010-11-04 11:26:13 +0000
commit7154795d71f1d293c5fb3c5673911f40bab05e01 (patch)
treeb56b6382cc4ef587ba7b1ae97a07f97c68a9e663 /sonar-server
parentfa39675d9807079cf5223bac2738fbcdb19a5166 (diff)
downloadsonarqube-7154795d71f1d293c5fb3c5673911f40bab05e01.tar.gz
sonarqube-7154795d71f1d293c5fb3c5673911f40bab05e01.zip
SONAR-1794: Handle a new type of "text" property value in the Quality Profile service
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb12
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb7
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();" %>
- <input name="value" type="text" size="<%= parameter.input_box_size -%>" value="<%= h param_value -%>" <%= 'disabled' unless active_rule && enable_modification %> />
- <% 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 += "<br/>" %>
+ <span id="<%= span_id %>"><%= (param_value.length < 50) ? textfield : textarea %></span>
+
+ <% if !read_only %>
<%= submit_tag 'update' %>
<img src="<%= ApplicationController.root_context -%>/images/loading.gif" style="display:none;" id="param_loading_<%= parameter.id -%>">
<% 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 %>
</tbody>
</table>
+<script type="text/javascript">
+ function replaceTextField(span_id, key) {
+ var text_field_value = $F(key);
+ var text_area = '<textarea cols="100" id="' + key + '" name="value" rows="10">' + text_field_value + '</textarea><br/>';
+ $(span_id).replace(text_area);
+ }
+</script>