ManageIQ/manageiq-ui-classic

View on GitHub
app/views/ops/_amazon_verify_button.html.haml

Summary

Maintainability
Test Coverage
= hidden_div_if(@edit[:new][:authentication][:amazon_key].nil? || @edit[:new][:authentication][:amazon_secret].nil?, :id => "amazon_verify_button_on") do
  = link_to(_("Validate"),
    {:action => "settings_update",
     :button => "amazon_verify",
     :id     => id},
    :class                 => "btn btn-primary btn-xs",
    :alt                   => t = _("Validate the Amazon Settings"),
    "data-miq_sparkle_on"  => true,
    "data-miq_sparkle_off" => true,
    :remote                => true,
    "data-method"          => :post,
    :title                 => t)

= hidden_div_if(!(@edit[:new][:authentication][:amazon_key].nil? || @edit[:new][:authentication][:amazon_secret].nil?), :id => "amazon_verify_button_off") do
  = button_tag(_("Validate"),
    :class => "btn btn-primary btn-xs disabled",
    :title => _("Amazon access key and secret are needed to validate Amazon Settings"))