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
%>
-<td class="form-key-cell">
- <%= parameter.name -%>
-</td>
+<td class="form-key-cell"><%= parameter.name -%></td>
+
<td class="form-val-cell">
<%= 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}"},
: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
- %>
<div id="error_<%= rule.id -%>" class="error" style="display: none"></div>
+
<span id="<%= span_id -%>"><%= param_value_input(parameter, param_value, :disabled => read_only) -%></span>
<% if !read_only %>
<% 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 %>
<img src="<%= ApplicationController.root_context -%>/images/overrides.png" alt="Overrides parent definition" title="<%= message('rules_configuration.overrides_parent_definition') -%>" style="vertical-align: middle"/>
<span class="form-val-note" style="font-weight: bold; vertical-align: middle;">
- <%= 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 -%>
</span>
- <%
- end
- end
- %>
- </form>
+ <% end %>
+ <% end %>
<div class="form-val-note"><%= h(parameter.description || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div>
+
+ </form>
</td>