%= javascript "lookup_keys" %>
<%= form_for @puppetclass, :html=>{:class=>"well"} do |f| %>
<%= base_errors_for @puppetclass %>
<%= text_f f, :name %>
<%= text_f f, :environments, :value => @puppetclass.environments.to_sentence, :class=>'span4', :label=> _('Puppet Environments'), :disabled => true %>
<%= multiple_checkboxes f, :hostgroups, @puppetclass, Hostgroup, :label => _("Hostgroups") %>
<% if @puppetclass.class_params.empty? -%>
×
<%= _('This Puppet class has no parameters in its signature.') %>
<%= _('To update the class signature, go to the Puppet Classes page and select "Import".') %>
<% else -%>
<%= _('Undo remove') %>
<%= _('Filter Parameters') -%>
<%= f.fields_for :class_params, f.object.class_params.all(:include => [:environment_classes, :environments, :lookup_values]) do |lookup_keys_form| %>
<%= render 'lookup_keys/fields', :f => lookup_keys_form %>
<% end %>
<% end -%>
<% if @puppetclass.lookup_keys.empty? -%>
×
<%= _('Help!') -%>
<%= (_('What is a Smart variable ?') % 'http://theforeman.org/projects/foreman/wiki/Smart_Variables').html_safe %>
<% end -%>
<%= _('Undo remove') %>
<% @puppetclass.lookup_keys.each do |key| -%>
<%= key %>×
<% end -%>
<%= link_to_function '+ ' + _("Add Variable"), "add_child_node(this);" ,:class=>"btn btn-success",:style=>":hover{}", :"data-association" => :lookup_keys %>
<%= f.fields_for :lookup_keys do |lookup_keys_form| %>
<%= render 'lookup_keys/fields', :f => lookup_keys_form %>
<% end %>
<%= new_child_fields_template(f, :lookup_keys, {:partial => "lookup_keys/fields"})%>
<%= submit_or_cancel f %>
<% end %>