<commit_before>- @angular_form = true

.form-horizontal{:id => "start_form_div", :style => "display:none"}
  = render :partial => "layouts/flash_msg"
  %div
    .form-group{"ng-class" => "{'has-error': angularForm.name.$invalid}"}
      %label.col-md-2.control-label{"for" => "textInput-markup"}
        = _('Name')
      .col-md-8
        %input.form-control{"type"           => "text",
                            "id"             => "textInput-markup",
                            "name"           => "name",
                            "ng-model"       => "emsCommonModel.name",
                            "maxlength"      => "#{MAX_NAME_LEN}",
                            "required"       => "",
                            "checkchange"    => "",
                            "auto-focus"     => "",
                            "start-form-div" => "start_form_div"}
        %span.help-block{"ng-show" => "angularForm.name.$error.required"}
          = _("Required")

    .form-group{"ng-class" => "{'has-error': angularForm.emstype.$invalid}"}
      %label.col-md-2.control-label{"for" => "textInput-markup"}
        = _('Type')
      .col-md-8
        = select_tag('emstype',
                     options_for_select([["<#{_('Choose')}>", nil]] + @ems_types, disabled: ["<#{_('Choose')}>", nil]),
                     "ng-if"                       => "newRecord",
                     "ng-model"                    => "emsCommonModel.emstype",
                     "ng-change"                   => "providerTypeChanged()",
                     "required"                    => "",
                     "checkchange"                 => "",
                     "selectpicker-for-select-tag" => "")
        %div{"ng-if" => "!newRecord"}
          %label.form-control{"type"        => "text",
                              "id"          => "textInput-markup",
                              "name"        => "emstype",
                              "ng-if"       => "!newRecord",
                              "readonly"    => true,
                              "style"       => "color: black; font-weight: normal;"}
            = @emstype_display

    .form-group{"ng-class" => "{'has-error': angularForm.api_version.$invalid}", "ng-if" => "emsCommonModel.emstype == 'openstack_infra'"}
      %label.col-md-2.control-label{"for" => "textInput-markup"}
        = _("API Version")
      .col-md-8
        = select_tag('api_version',
                     options_for_select(@openstack_api_versions),
                     "ng-model"                    => "emsCommonModel.api_version",
                     "checkchange"                 => "",
                     "selectpicker-for-select-tag" => "")

    .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}"}
      %label.col-md-2.control-label{"for" => "textInput-markup"}
        = _("Zone")
      .col-md-8
        - if @server_zones.length <= 1
          %input.form-control{"type"        => "text",
                              "id"          => "textInput-markup",
                              "name"        => "zone",
                              "ng-model"    => "emsCommonModel.zone",
                              "maxlength"   => 15,
                              "required"    => "",
                              "checkchange" => "",
                              "readonly"    => true,
                              "style"       => "color: black;"}
        - else
          = select_tag('zone',
                       options_for_select(@server_zones.sort_by { |name, _name| name }),
                       "ng-model"                    => "emsCommonModel.zone",
                       "checkchange"                 => "",
                       "required"                    => "",
                       "selectpicker-for-select-tag" => "")

    .form-group{"ng-class" => "{'has-error': angularForm.host_default_vnc_port_start.$invalid}", "ng-if" => "formId != 'new' && emsCommonModel.emstype == 'vmwarews'"}
      %label.col-md-2.control-label{"for" => "textInput-markup"}
        = _('Host Default VNC Start Port')
      .col-md-8
        %input.form-control{"type"        => "text",
                            "id"          => "textInput-markup",
                            "name"        => "host_default_vnc_port_start",
                            "ng-model"    => "emsCommonModel.host_default_vnc_port_start",
                            "maxlength"   => 6,
                            "checkchange" => ""}

    .form-group{"ng-class" => "{'has-error': angularForm.host_default_vnc_port_end.$invalid}", "ng-if" => "formId != 'new' && emsCommonModel.emstype == 'vmwarews'"}
      %label.col-md-2.control-label{"for" => "textInput-markup"}
        = _('Host Default VNC End Port')
      .col-md-8
        %input.form-control{"type"        => "text",
                            "id"          => "textInput-markup",
                            "name"        => "host_default_vnc_port_end",
                            "ng-model"    => "emsCommonModel.host_default_vnc_port_end",
                            "maxlength"   => 6,
                            "checkchange" => ""}

  %hr
    - if controller_name == "ems_container"
      = render :partial => "/layouts/container_auth", :locals  => {:record => @ems}
    - else
      %div{"ng-show" => "emsCommonModel.emstype != '' && emsCommonModel.emstype == 'azure'"}
        %h3
          = _("Credentials")
        = render :partial => "/layouts/angular-bootstrap/auth_credentials_angular_bootstrap",
                 :locals  => {:record                 => @ems,
                              :ng_model               => "emsCommonModel",
                              :ng_reqd_password       => "<PASSWORD> != ''",
                              :ng_reqd_verify         => "emsCommonModel.default_userid != ''",
                              :prefix                 => "default",
                              :validate_url           => @ems.id ? "update" : "create",
                              :id                     => @ems.id || "new",
                              :basic_info_needed      => true,
                              :userid_label           => _("Client ID"),
                              :password_label         => _("Client Key"),
                              :verify_label           => _("Confirm Client Key"),
                              :passwd_mismatch        => _("Client Keys do not match"),
                              :change_stored_password => _("<PASSWORD> stored client key"),<commit_msg>Fix duplicate and wrong ids in ems_infra form. (transferred from ManageIQ/manageiq@71e7a65309f2c0ee09d5bf3fbf827241c4067a70)<commit_after>- @angular_form = true

.form-horizontal{:id => "start_form_div", :style => "display:none"}
  = render :partial => "layouts/flash_msg"
  %div
    .form-group{"ng-class" => "{'has-error': angularForm.name.$invalid}"}
      %label.col-md-2.control-label{"for" => "ems_name"}
        = _('Name')
      .col-md-8
        %input.form-control{"type"           => "text",
                            "id"             => "ems_name",
                            "name"           => "name",
                            "ng-model"       => "emsCommonModel.name",
                            "maxlength"      => "#{MAX_NAME_LEN}",
                            "required"       => "",
                            "checkchange"    => "",
                            "auto-focus"     => "",
                            "start-form-div" => "start_form_div"}
        %span.help-block{"ng-show" => "angularForm.name.$error.required"}
          = _("Required")

    .form-group{"ng-class" => "{'has-error': angularForm.emstype.$invalid}"}
      %label.col-md-2.control-label{"for" => "ems_type"}
        = _('Type')
      .col-md-8
        = select_tag('emstype',
                     options_for_select([["<#{_('Choose')}>", nil]] + @ems_types, disabled: ["<#{_('Choose')}>", nil]),
                     "ng-if"                       => "newRecord",
                     "ng-model"                    => "emsCommonModel.emstype",
                     "ng-change"                   => "providerTypeChanged()",
                     "required"                    => "",
                     "checkchange"                 => "",
                     "selectpicker-for-select-tag" => "")
        %div{"ng-if" => "!newRecord"}
          %label.form-control{"type"        => "text",
                              "id"          => "ems_type",
                              "name"        => "emstype",
                              "ng-if"       => "!newRecord",
                              "readonly"    => true,
                              "style"       => "color: black; font-weight: normal;"}
            = @emstype_display

    .form-group{"ng-class" => "{'has-error': angularForm.api_version.$invalid}", "ng-if" => "emsCommonModel.emstype == 'openstack_infra'"}
      %label.col-md-2.control-label{"for" => "ems_api_version"}
        = _("API Version")
      .col-md-8
        = select_tag('api_version',
                     options_for_select(@openstack_api_versions),
                     "ng-model"                    => "emsCommonModel.api_version",
                     "id"                          => "ems_api_version",
                     "checkchange"                 => "",
                     "selectpicker-for-select-tag" => "")

    .form-group{"ng-class" => "{'has-error': angularForm.zone.$invalid}"}
      %label.col-md-2.control-label{"for" => "ems_zone"}
        = _("Zone")
      .col-md-8
        - if @server_zones.length <= 1
          %input.form-control{"type"        => "text",
                              "id"          => "ems_zone",
                              "name"        => "zone",
                              "ng-model"    => "emsCommonModel.zone",
                              "maxlength"   => 15,
                              "required"    => "",
                              "checkchange" => "",
                              "readonly"    => true,
                              "style"       => "color: black;"}
        - else
          = select_tag('zone',
                       options_for_select(@server_zones.sort_by { |name, _name| name }),
                       "ng-model"                    => "emsCommonModel.zone",
                       "id"                          => "ems_zone",
                       "checkchange"                 => "",
                       "required"                    => "",
                       "selectpicker-for-select-tag" => "")

    .form-group{"ng-class" => "{'has-error': angularForm.host_default_vnc_port_start.$invalid}", "ng-if" => "formId != 'new' && emsCommonModel.emstype == 'vmwarews'"}
      %label.col-md-2.control-label{"for" => "ems_vnc_start_port"}
        = _('Host Default VNC Start Port')
      .col-md-8
        %input.form-control{"type"        => "text",
                            "id"          => "ems_vnc_start_port",
                            "name"        => "host_default_vnc_port_start",
                            "ng-model"    => "emsCommonModel.host_default_vnc_port_start",
                            "maxlength"   => 6,
                            "checkchange" => ""}

    .form-group{"ng-class" => "{'has-error': angularForm.host_default_vnc_port_end.$invalid}", "ng-if" => "formId != 'new' && emsCommonModel.emstype == 'vmwarews'"}
      %label.col-md-2.control-label{"for" => "ems_vnc_end_port"}
        = _('Host Default VNC End Port')
      .col-md-8
        %input.form-control{"type"        => "text",
                            "id"          => "ems_vnc_end_port",
                            "name"        => "host_default_vnc_port_end",
                            "ng-model"    => "emsCommonModel.host_default_vnc_port_end",
                            "maxlength"   => 6,
                            "checkchange" => ""}

  %hr
    - if controller_name == "ems_container"
      = render :partial => "/layouts/container_auth", :locals  => {:record => @ems}
    - else
      %div{"ng-show" => "emsCommonModel.emstype != '' && emsCommonModel.emstype == 'azure'"}
        %h3
          = _("Credentials")
        = render :partial => "/layouts/angular-bootstrap/auth_credentials_angular_bootstrap",
                 :locals  => {:record                 => @ems,
                              :ng_model               => "emsCommonModel",
                              :ng_reqd_password       => "emsCommonModel.default_userid != ''",
                              :ng_reqd_verify         => "emsCommonModel.default_userid != ''",
                              :prefix                 => "default",
                              :validate_url           => @ems.id ? "update" : "create",
                              :id                     => @ems.id || "new",
                              :basic_info_needed      => true,
                              :userid_label           => _("Client ID"),
                              :password_label         => _("Client Key"),
                              :verify_label           => _("Confirm Client Key"),
                              :passwd_mismatch        => _("Client Keys do not match"),
                              :change_stored_password => _("Change <PASSWORD> key"),
{'fraction_non_alphanumeric': 0.15347165006366564, 'fraction_numerical': 0.004643846902853719, 'mean_word_length': 1.1802743305029393, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 188, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2473116', 'n_tokens_mistral': 3713, 'n_tokens_neox': 3613, 'n_words': 506}