From: David Gageot Date: Fri, 6 Jul 2012 11:40:08 +0000 (+0200) Subject: SONAR-3432 Clean-up ruby code X-Git-Tag: 3.2~203 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8c4d881a7b970ed3d536492be38026e5f7ef67c6;p=sonarqube.git SONAR-3432 Clean-up ruby code --- 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 7fbf65ade5c..43fdece4bbb 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 @@ -7,11 +7,12 @@ end active_rule_id = active_rule.id if active_rule enable_modification = is_admin && !profile.provided? + span_id = "text_#{parameter.id}" + read_only = !active_rule || !enable_modification %> - - <%= parameter.name -%> - +<%= parameter.name -%> + <%= 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 => {:success => "rule_#{rule.id}", :failure => "error_#{rule.id}"}, @@ -20,11 +21,8 @@ :failure => "$('error_#{rule.id}').show();$('param_loading_#{parameter.id}').hide();", :html => {:name => "form-#{u parameter.name}"} %> - <% - span_id = "text_#{parameter.id}" - read_only = !active_rule || !enable_modification - %> + <%= param_value_input(parameter, param_value, :disabled => read_only) -%> <% if !read_only %> @@ -35,22 +33,20 @@ <% end %> <% end %> - <% - if active_rule && active_rule.overrides? && ancestor_active_rule + <% if active_rule && active_rule.overrides? && ancestor_active_rule ancestor_param = ancestor_active_rule.active_param_by_param_id(parameter.id) ancestor_value = ancestor_param && ancestor_param.value ? ancestor_param.value : '' - - if ancestor_value != param_value %> + <% if ancestor_value != param_value %> Overrides parent definition - <%= message('rules_configuration.original_value') -%>: <%= ancestor_value.blank? ? '(' + message('rules_configuration.parent_parameter.empty') + ')' : ancestor_value -%> + <%= message('rules_configuration.original_value') -%> + : <%= ancestor_value.blank? ? '(' + message('rules_configuration.parent_parameter.empty') + ')' : ancestor_value -%> - <% - end - end - %> - + <% end %> + <% end %>
<%= h(parameter.description || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%>
+ +