Project

General

Profile

Download (2.39 KB) Statistics
| Branch: | Tag: | Revision:
<%
# LookupValue#match is generated automatically by Host#lookup_values_attributes=
# from the name, so don't present errors directly to the user. Any validation
# errors should also be visible against the Host#name field.
if f.object.errors[:match].any?
logger.debug("Ignoring #{f.object.inspect} match errors: #{f.object.errors[:match]}")
f.object.errors.delete(:match)
end
%>
<div class="fields">
<table class="row">
<tbody>
<tr class="form-group <%= 'has-error' if f.object.errors.any? %>">
<td class="col-md-3">
<%= f.hidden_field :lookup_key_id, :'data-property' => 'lookup_key_id' %>
<% puppetclass = f.object.lookup_key ? f.object.lookup_key.puppetclass || f.object.lookup_key.param_class : nil %>
<%= text_field_tag '', (puppetclass.name rescue ''), :class => 'form-control', :'data-property' => 'class', :disabled => true, :title => _('Puppetclass') %>
</td>
<td class="col-md-2">
<%= text_field_tag '', (f.object.lookup_key.key rescue ''), :class => 'form-control', :'data-property' => 'name', :disabled => true, :title => _('Parameter name') %>
</td>
<td class="col-md-4">
<%= f.text_area :value, :rows => line_count(f, :value), :class => 'form-control', :'data-property' => 'value',
:disabled => (not authorized_via_my_scope("host_editing", "edit_params")) || f.object.use_puppet_default,
:placeholder => _("Value") %>
<%= text_field_tag '', (f.object.lookup_key.key_type rescue 'unknown'), :class=> 'hide', :'data-property' => 'type', :disabled => true, :title => _('Parameter type') %>
</td>
<td class="col-md-1">
<%= fullscreen_button("$(this).parent().prev().find('textarea')") %>
</td>
<td class="col-md-4">
<%= f.check_box :use_puppet_default, :'data-property' => 'use_puppet_default',
:disabled => (not authorized_via_my_scope("host_editing", "edit_params")),
:onchange=>'toggleUsePuppetDefaultValue(this, "value")' %>
<%= use_puppet_default_help('') %>
</td>
<td>
<span class="help-block">
<%= link_to_remove_fields('', f) %>
</span>
</td>
<span class="help-block">
<%= f.object.errors.full_messages.to_sentence %>
</span>
</tr>
</tbody>
</table>
</div>
(6-6/11)