ManageIQ/manageiq-ui-classic

View on GitHub
app/views/miq_ae_customization/_old_dialogs_form.html.haml

Summary

Maintainability
Test Coverage
- url = url_for_only_path(:action => 'old_dialogs_form_field_changed', :id => (@dialog.id || 'new'))
#form_div
  = render :partial => "layouts/flash_msg"
  %h3
    = _('Basic Information')
  .form-horizontal
    .form-group
      %label.col-md-2.control-label
        = _('Name')
      .col-md-8
        = text_field_tag("name",
                          @edit[:new][:name],
                          :maxlength         => ViewHelper::MAX_NAME_LEN,
                          :class => "form-control",
                          "data-miq_observe" => {:interval => '.5', :url => url}.to_json)
        = javascript_tag(javascript_focus('name'))
    .form-group
      %label.col-md-2.control-label
        = _('Description')
      .col-md-8
        = text_field_tag("description",
                          @edit[:new][:description],
                          :maxlength         => 100,
                          :class => "form-control",
                          "data-miq_observe" => {:interval => '.5', :url => url}.to_json)
    .form-group
      %label.col-md-2.control-label
        = _('Type')
        - miq_dialog_s = MiqDialog::DIALOG_TYPES.map { |label, model| [_(label), model] }.sort
        - dialog_types = @dialog.dialog_type ? miq_dialog_s : [["<#{_('Choose')}>", nil]] + miq_dialog_s
      .col-md-8
        = select_tag('dialog_type',
                      options_for_select(dialog_types,
                                          @edit[:new][:dialog_type]),
                      :class    => "selectpicker")
        :javascript
          miqInitSelectPicker();
          miqSelectPickerEvent("dialog_type", "#{url}")
  %hr
  %h3
    = _('Content')
  = text_area_tag("content_data",
    @edit[:new][:content],
    :style => "display:none;")
  = render(:partial => "layouts/my_code_mirror",
    :locals         => {:text_area_id => "content_data",
      :mode                           => "yaml",
      :line_numbers                   => true,
      :url                            => url})