aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-07-06 14:11:32 +0200
committerDavid Gageot <david@gageot.net>2012-07-06 14:11:32 +0200
commit71e6bab704aab2243329bc2b07c8c9eb56a03943 (patch)
tree9c626a97eea995b7376d9be875120267714ce87e /sonar-server/src/main
parent569cd7b64625fcc9b4cbf1c43d0687978a821411 (diff)
downloadsonarqube-71e6bab704aab2243329bc2b07c8c9eb56a03943.tar.gz
sonarqube-71e6bab704aab2243329bc2b07c8c9eb56a03943.zip
SONAR-3432 Simplify Ruby code
Diffstat (limited to 'sonar-server/src/main')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb18
1 files changed, 6 insertions, 12 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 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?
%>
<td class="form-key-cell"><%= parameter.name -%></td>
@@ -23,9 +17,9 @@
<div id="error_<%= parameter.id -%>" class="error" style="display: none"></div>
- <span id="<%= span_id -%>"><%= param_value_input(parameter, param_value, :disabled => read_only) -%></span>
+ <span id="text_<%= parameter.id -%>"><%= param_value_input(parameter, param_value, :disabled => read_only) -%></span>
- <% if !read_only %>
+ <% unless read_only %>
<%= submit_tag message('update_verb') %>
<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 %>