<commit_before>- ng_show                   ||= true
- validate_url              ||= 'create'
- prefix                    ||= 'ssh_keypair'
- userid_label              ||= _("Username")
- private_key_label         ||= _("Private Key")
- new_private_key_label     ||= _("New ") + private_key_label
- ng_reqd_userid            ||= false
- ng_reqd_private_key       ||= false
- userid_disabled           ||= false
- private_key_disabled      ||= false
- change_stored_private_key ||= _("Change stored private key")
- cancel_private_key_change ||= _("Cancel private key change")
- verify_title_off          ||= _("Server information, username and private key fields are needed to perform verification of credentials")

%div{"ng-controller" => "emsKeypairController as vm", "ng-init" => "vm.initialize(#{ng_model}, formId)"}
  %div{"ng-show" => "#{ng_show}"}
    .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_userid.$error.required}"}
      %label.col-md-2.control-label{"for" => "#{prefix}_userid"}
        = userid_label
      .col-md-4
        %input.form-control{"type"        => "text",
                            "id"          => "#{prefix}_userid",
                            "ng-required" => "#{ng_reqd_userid}",
                            "ng-disabled" => userid_disabled,
                            "name"        => "#{prefix}_userid",
                            "ng-model"    => "#{ng_model}.#{prefix}_userid",
                            "checkchange" => ""}
        %span.help-block{"ng-show" => "angularForm.#{prefix}_userid.$error.required"}
          = _("Required")
        .note
          {{note}}

  %div{"ng-show" => "#{ng_show}"}
    .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_password.$error.required}"}
      %label.col-md-2.control-label{"for" => "#{prefix}_password"}
        %div{"ng-show" => "!vm.changeKey"}
          = private_key_label
        %div{"ng-show" => "vm.changeKey"}
          = new_private_key_label
      .col-md-4
        %div{"ng-if" => "vm.inEditMode('#{prefix}_userid')"}
          %input.form-control{"type"         => "file",
                              "id"           => "#{prefix}_password",
                              "ng-required"  => "#{ng_reqd_private_key}",
                              "ng-disabled"  => "!vm.inEditMode('#{prefix}_userid')" || private_key_disabled,
                              "ng-model"     => "#{ng_model}.#{prefix}_password",
                              "prefix"       => "#{prefix}",
                              "name"         => "#{prefix}_password",
                              "checkchange"  => "",
                              "require-file" => ""}
        %div{"ng-if" => "!vm.inEditMode('#{prefix}_userid')"}
          %textarea.form-control{"id"           => "textInput-markup",
                                 "ng-required"  => "#{ng_reqd_private_key}",
                                 "ng-disabled"  => "!vm.inEditMode('#{prefix}_userid')" || private_key_disabled,
                                 "ng-model"     => "#{ng_model}.#{prefix}_password",
                                 "prefix"       => "#{prefix}",
                                 "name"         => "#{prefix}_password",
                                 "checkchange"  => "",
                                 "require-file" => "",
                                 "rows"         => 1}
        %textarea{"id"          => "textInput-markup",
                  "name"        => "#{prefix}_password",
                  "style"       => "display: none !important",
                  "ng-model"    => "#{ng_model}.#{prefix}_password",
                  "ng-disabled" => "!vm.inEditMode('#{prefix}_userid')" || private_key_disabled,
                  "checkchange" => ""}
        %span.help-block{"ng-show" => "angularForm.#{prefix}_password.$error.required"}
          = _("Required")
      %div{"ng-if" => "vm.showChangePrivateKeyLinks('#{prefix}_userid')"}
        %a{:href => "", "ng-hide" => "vm.changeKey", "ng-click" => "vm.changeStoredPrivateKey()"}
          = change_stored_private_key
        %a{:href => "", "ng-show" => "vm.changeKey", "ng-click" => "vm.cancelPrivateKeyChange()"}<commit_msg>Give RSA keypaid upload form elements proper IDs<commit_after>- ng_show                   ||= true
- validate_url              ||= 'create'
- prefix                    ||= 'ssh_keypair'
- userid_label              ||= _("Username")
- private_key_label         ||= _("Private Key")
- new_private_key_label     ||= _("New ") + private_key_label
- ng_reqd_userid            ||= false
- ng_reqd_private_key       ||= false
- userid_disabled           ||= false
- private_key_disabled      ||= false
- change_stored_private_key ||= _("Change stored private key")
- cancel_private_key_change ||= _("Cancel private key change")
- verify_title_off          ||= _("Server information, username and private key fields are needed to perform verification of credentials")

%div{"ng-controller" => "emsKeypairController as vm", "ng-init" => "vm.initialize(#{ng_model}, formId)"}
  %div{"ng-show" => "#{ng_show}"}
    .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_userid.$error.required}"}
      %label.col-md-2.control-label{"for" => "#{prefix}_userid"}
        = userid_label
      .col-md-4
        %input.form-control{"type"        => "text",
                            "id"          => "#{prefix}_userid",
                            "ng-required" => "#{ng_reqd_userid}",
                            "ng-disabled" => userid_disabled,
                            "name"        => "#{prefix}_userid",
                            "ng-model"    => "#{ng_model}.#{prefix}_userid",
                            "checkchange" => ""}
        %span.help-block{"ng-show" => "angularForm.#{prefix}_userid.$error.required"}
          = _("Required")
        .note
          {{note}}

  %div{"ng-show" => "#{ng_show}"}
    .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_password.$error.required}"}
      %label.col-md-2.control-label{"for" => "#{prefix}_password"}
        %div{"ng-show" => "!vm.changeKey"}
          = private_key_label
        %div{"ng-show" => "vm.changeKey"}
          = new_private_key_label
      .col-md-4
        %div{"ng-if" => "vm.inEditMode('#{prefix}_userid')"}
          %input.form-control{"type"         => "file",
                              "id"           => "#{prefix}_password",
                              "ng-required"  => "#{ng_reqd_private_key}",
                              "ng-disabled"  => "!vm.inEditMode('#{prefix}_userid')" || private_key_disabled,
                              "ng-model"     => "#{ng_model}.#{prefix}_password",
                              "prefix"       => "#{prefix}",
                              "name"         => "#{prefix}_password",
                              "checkchange"  => "",
                              "require-file" => ""}
        %div{"ng-if" => "!vm.inEditMode('#{prefix}_userid')"}
          %textarea.form-control{"id"           => "#{prefix}_password",
                                 "ng-required"  => "#{ng_reqd_private_key}",
                                 "ng-disabled"  => "!vm.inEditMode('#{prefix}_userid')" || private_key_disabled,
                                 "ng-model"     => "#{ng_model}.#{prefix}_password",
                                 "prefix"       => "#{prefix}",
                                 "name"         => "#{prefix}_password",
                                 "checkchange"  => "",
                                 "require-file" => "",
                                 "rows"         => 1}
        %textarea{"id"          => "#{prefix}_password",
                  "name"        => "#{prefix}_password",
                  "style"       => "display: none !important",
                  "ng-model"    => "#{ng_model}.#{prefix}_password",
                  "ng-disabled" => "!vm.inEditMode('#{prefix}_userid')" || private_key_disabled,
                  "checkchange" => ""}
        %span.help-block{"ng-show" => "angularForm.#{prefix}_password.$error.required"}
          = _("Required")
      %div{"ng-if" => "vm.showChangePrivateKeyLinks('#{prefix}_userid')"}
        %a{:href => "", "ng-hide" => "vm.changeKey", "ng-click" => "vm.changeStoredPrivateKey()"}
          = change_stored_private_key
        %a{:href => "", "ng-show" => "vm.changeKey", "ng-click" => "vm.cancelPrivateKeyChange()"}
{'fraction_non_alphanumeric': 0.17876169054102048, 'fraction_numerical': 0.0011838522552385462, 'mean_word_length': 1.6466165413533835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 107, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6274946', 'n_tokens_mistral': 2461, 'n_tokens_neox': 2442, 'n_words': 334}