theforeman/foreman-digitalocean

View on GitHub
app/views/compute_resources/form/_digitalocean.html.erb

Summary

Maintainability
Test Coverage
<%= password_f f, :password, :label => _("API Key"), :unset => unset_password? %>
<% regions = f.object.regions rescue [] %>

<div id='region_selection'>
  <%= selectable_f(f, :region, regions.map(&:slug), {},
    :label => _('Default Region'), :disabled => regions.empty?,
    :help_inline => link_to_function(
      regions.empty? ? _("Load Regions") : _("Test Connection"), "testConnection(this)",
      :class => "btn + #{regions.empty? ? "btn-default" : "btn-success"}",
      :'data-url' => test_connection_compute_resources_path) +
     hidden_spinner('', :id => 'test_connection_indicator').html_safe) %>
</div>