From: David Gageot Date: Fri, 6 Jul 2012 12:11:32 +0000 (+0200) Subject: SONAR-3432 Simplify Ruby code X-Git-Tag: 3.2~199 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=71e6bab704aab2243329bc2b07c8c9eb56a03943;p=sonarqube.git SONAR-3432 Simplify 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 2126c89bbd7..5d2565854b8 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 @@ -1,14 +1,8 @@ -<% #locals : parameter, active_parameter, active_rule, is_admin, rule, profile, ancestor_active_rule - active_param_id = nil - param_value = parameter.default_value || '' - if active_parameter - active_param_id = active_parameter.id - param_value = active_parameter.value unless active_parameter.value.blank? - end +<% param_value = parameter.default_value || '' + param_value = active_parameter.value if active_parameter + active_param_id = active_parameter.id if active_parameter 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 + read_only = !active_rule || !is_admin || profile.provided? %> <%= parameter.name -%> @@ -23,9 +17,9 @@ - <%= param_value_input(parameter, param_value, :disabled => read_only) -%> + <%= param_value_input(parameter, param_value, :disabled => read_only) -%> - <% if !read_only %> + <% unless read_only %> <%= submit_tag message('update_verb') %> <% if active_parameter and active_parameter.errors.size>0 %>