<%= bootstrap_form_for(@host, layout: :horizontal, label_col: 'col-xs-3', control_col: 'col-xs-8') do |f| %>

FQDN should have a valid DNS A record

<% if current_user.needs_host_list? %> <%= f.select :fqdn, options_for_select(@hosts_of_user, @host.fqdn), { label: 'FQDN' }, disabled: @host.persisted? %> <% else %> <%= f.text_field :fqdn, label: 'FQDN', disabled: @host.persisted? %> <% end %> <% if @host.persisted? %> <%= f.number_field :port, min: 1 %> <% end %> <% emails = (@host.users.pluck(:email) + @host.email_recipients).uniq.select(&:present?) %> <%= f.select :email_recipients, options_for_select(emails, @host.email_recipients), {}, multiple: true %>
<%= link_to @host.persisted? ? host_path(@host) : clients_path, class: 'btn btn-default' do %> Cancel <% end %>
<% if @host.persisted? %> <%= link_to regenerate_token_host_path(@host), method: :post, class: 'btn btn-default', data: { confirm: 'Are you sure you want to regenrate the server token' } do %> Regenerate Token <% end %> <% end %>
<%= f.submit 'Submit', class: 'btn btn-success' %>
<% end %>