Page MenuHomeGRNET

_form.html.erb
No OneTemporary

File Metadata

Created
Sun, May 18, 12:00 AM

_form.html.erb

<%= bootstrap_form_for(@host, layout: :horizontal,
label_col: 'col-xs-3', control_col: 'col-xs-8') do |f| %>
<div>
<% 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 %>
<% emails = (@host.users.pluck(:email) + @host.email_recipients).uniq.select(&:present?) %>
<%= f.select :email_recipients, options_for_select(emails, @host.email_recipients), {},
multiple: true %>
</div>
<div class="form-group">
<div class="col-xs-offset-3 col-xs-2">
<%= f.submit class: 'btn btn-success' %>
</div>
<% if current_user.vima? %>
<div class="col-xs-offset-3 col-xs-2">
<%= link_to fetch_vima_hosts_path, role: :button, class: 'btn btn-default' do %>
<label class="glyphicon glyphicon-refresh text-primary"></label>
Fetch Hosts
<% end %>
</div>
<% end %>
</div>
<% end %>

Event Timeline