Page MenuHomeGRNET

_form.html.erb
No OneTemporary

File Metadata

Created
Sun, May 18, 5:52 PM

_form.html.erb

<%= 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 %>
<% 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 %>
<div class="form-group">
<div class='row'>
<div class="col-xs-offset-5 col-xs-2 text-right">
<%= link_to 'Cancel', @host.persisted? ? host_path(@host) : clients_path,
class: 'btn btn-danger' %>
</div>
<div class="col-xs-2 text-right">
<%= f.submit 'Submit', class: 'btn btn-success' %>
</div>
</div>
</div>
<% end %>

Event Timeline