-<% #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>
<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 %>