ManageIQ/manageiq-ui-classic

View on GitHub
app/views/layouts/exp_atom/_edit_count.html.haml

Summary

Maintainability
Test Coverage
- url = url_for_only_path(:action => 'exp_changed')

-#
  Parameters:
    exp_model       Model in use for this expression

.spacer
= select_tag('chosen_count',
  options_for_select(["<#{_('Choose')}>"] + MiqExpression.miq_adv_search_lists(exp_model, :exp_available_counts), @edit[@expkey][:exp_count]),
  :multiple              => false,
  :class                 => 'selectpicker',
  "data-miq_sparkle_on"  => true,
  "data-miq_sparkle_off" => true)

- if adv_search_show_alias_checkbox? && !@edit[@expkey][:exp_count].blank?
  = check_box_tag("use_alias", "1", !@edit[@expkey][:alias].blank?,
    :style                      => "width: 20px; margin-top:5px; margin-bottom: 5px;",
    "data-miq_sparkle_on"       => true,
    "data-miq_sparkle_off"      => true,
    "data-miq_observe_checkbox" => {:url => url}.to_json)
  = _('Use Alias')
  - unless @edit[@expkey][:alias].blank?
    = text_field_tag("alias", @edit[@expkey][:alias],
      :maxlength         => 50,
      "data-miq_observe" => {:interval => '.5', :url => url}.to_json)

- if @edit[@expkey][:exp_count]
  .spacer
  = select_tag('chosen_key',
    options_for_select(MiqExpression.get_col_operators(:count), @edit[@expkey][:exp_key]),
    :multiple              => false,
    :class                 => 'selectpicker',
    "data-miq_sparkle_on"  => true,
    "data-miq_sparkle_off" => true,
    "data-miq_observe"     => {:url => url}.to_json)
  .spacer
  - if @edit[@expkey][:exp_value] == :user_input
    = "<#{_('user input')}>"
  - else
    %span#chosen_value_span
      = text_field_tag("chosen_value", @edit[@expkey][:exp_value],
        :maxlength         => 500,
        "data-miq_observe" => {:interval => '.5', :url => url}.to_json)

:javascript
  miqInitSelectPicker();
  miqSelectPickerEvent('chosen_key', '#{url}');
  miqSelectPickerEvent('chosen_count', '#{url}');