ManageIQ/manageiq-ui-classic

View on GitHub
app/views/chargeback_rate/_tier_row.haml

Summary

Maintainability
Test Coverage
- i = params[:detail_index]
- url = url_for_only_path(:action => 'form_field_changed', :id => (@edit[:rec_id] || "new"))
- n = @edit[:new][:num_tiers][i.to_i]
- n = params[:tier_row] if params[:tier_row]

%tr.rdetail.new_tier{:id => "rate_detail_row_#{i}_#{n - 1}"}
  = render :partial => 'cb_tier_edit_values', :locals => {:detail_index => i.to_i, :url => url, :row_within_rate => n - 1}
  %td.action-cell
    = button_tag(_("Delete"),
                 :class   => "btn btn-default",
                 :alt     => t = _("Remove the tier"),
                 :title   => t,
                 :onclick => "miqAjaxButton('#{url_for_only_path(:action => "tier_remove",
                                                       :index  => i + "-#{n - 1}",
                                                       :button => "remove")}');")
  :javascript
    $(document).ready(function () {
        $('.new_tier').fadeIn().fadeOut().fadeIn().fadeOut().fadeIn().fadeOut().fadeIn();
        $('.new_tier').addClass('new_tier_off').removeClass('new_tier');
    });
    $('tbody tr.rdetail').hover( function(){hoverRowIn(this)}, function(row){hoverRowOut(this)});