diff --git a/app/views/hosts/_form.html.erb b/app/views/hosts/_form.html.erb index ae8d211..c8d3a1f 100644 --- a/app/views/hosts/_form.html.erb +++ b/app/views/hosts/_form.html.erb @@ -1,32 +1,34 @@ <%= bootstrap_form_for(@host, layout: :horizontal, label_col: 'col-xs-3', control_col: 'col-xs-8') do |f| %>
<% if current_user.needs_host_list? %> <%= f.select :fqdn, options_for_select(@hosts_of_user, @host.fqdn), {}, disabled: @host.persisted? %> <% else %> <%= f.text_field :fqdn, disabled: @host.persisted? %> <% end %> - <%= f.password_field :password, required: true, value: @host.password %> - <%= f.number_field :port, min: 1 %> + <% if @host.persisted? %> + <%= f.password_field :password, label: 'Token', value: @host.password %> + <%= 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 %>
- <%= f.submit class: 'btn btn-success' %> + <%= f.submit 'Submit', class: 'btn btn-success' %>
<% if current_user.vima? %>
<%= link_to fetch_vima_hosts_path, role: :button, class: 'btn btn-default' do %> Fetch Clients <% end %>
<% end %>
<% end %>