%= form_for @discovery_rule, :url => (@discovery_rule.new_record? ? discovery_rules_path : discovery_rule_path(:id => @discovery_rule.id)) do |f| %>
<%= base_errors_for @discovery_rule %>
<%= text_f f, :name %>
<%= autocomplete_f f, :search,
:path => "discovered_hosts",
:control_group_id => 'search_group', :size => 'col-md-9' %>
<%= select_f f, :hostgroup_id, accessible_resource_records(:hostgroup, :title).to_a, :id, :to_label, { :include_blank => false },
{ :help_inline => _('Target host group for this rule with all properties set') } %>
<%= text_f f, :hostname, :help_inline => popover(
_("Template"),
render('discovery_rules/template_inline'),
:title => _("Hostname for provisioned hosts"), :'data-placement' => 'bottom').html_safe %>
<%= text_f f, :max_count, :label => _('Hosts limit'), :help_inline => _('Maximum hosts provisioned with this rule (0 = unlimited)') %>
<%= text_f f, :priority, :help_inline => _('Rule priority (lower integer means higher priority)') %>
<%= checkbox_f f, :enabled %>
<% if show_taxonomy_tabs? %>
<%= render 'taxonomies/loc_org_tabs', :f => f, :obj => @discovery_rule %>
<% end %>
<%= submit_or_cancel f %>
<% end %>