<commit_before>- ng_show                ||= true
- validate_url           ||= 'log_depot_edit'
- prefix                 ||= 'log'
- userid_label           ||= _("Username")
- password_label         ||= _("Password")
- new_password_label     ||= _("<PASSWORD> ") + password_label
- ng_reqd_userid         ||= false
- ng_reqd_password       ||= false
- userid_disabled        ||= false
- password_disabled      ||= false
- change_stored_password ||= _("<PASSWORD>")
- cancel_password_change ||= _("Cancel password change")
- verify_title_off       ||= _("Server information, Username and matching password fields are needed to perform verification of credentials")
- ng_show_userid         ||= true
- ng_show_password       ||= true
- guid_regex             ||= false
- vm_scope               ||= false
- main_scope            = vm_scope ? "$parent.vm" : "$parent"

%div{"ng-controller" => "CredentialsController as vm", "vm-scope" => "$parent.vm.model ? $parent.vm : $parent"}
  %div{"ng-show" => "#{ng_show} && #{ng_show_userid}"}
    .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_userid.$invalid}"}
      %label.col-md-2.control-label{"for" => "#{prefix}_userid"}
        = userid_label
      .col-md-4
        - hash_for_userid = {"type"                    => "text",
                             "id"                      => "#{prefix}_userid",
                             "ng-required"             => "#{ng_reqd_userid}",
                             "ng-disabled"             => userid_disabled,
                             "name"                    => "#{prefix}_userid",
                             "ng-model"                => "#{main_scope}.#{ng_model}.#{prefix}_userid",
                             "checkchange"             => "",
                             "ng-trim"                 => false,
                             "detect_spaces"           => "",
                             "prefix"                  => "#{prefix}",
                             "main-scope"              => "#{main_scope}",
                             "reset-validation-status" => "#{prefix}_auth_status"}
        - hash_for_userid['is-uuid'] = 4 if guid_regex
        %input.form-control{hash_for_userid}
        %span.help-block{"ng-show" => "angularForm.#{prefix}_userid.$error.required"}
          = _("Required")
        %span.help-block{"ng-show" => "angularForm.#{prefix}_userid.$error.detectedSpaces"}
          = _("Spaces are prohibited")
        %span.help-block{"ng-show" => "angularForm.#{prefix}_userid.$error.isUuid"}
          = _("Invalid input format, please enter a GUID")
        .note{"ng-if" => "emsCommonModel.emstype == 'scvmm' && emsCommonModel.default_security_protocol == 'kerberos'"}
          = _("Note: Username must be in the format: name@realm")

  %div{"ng-show" => "#{ng_show} && #{ng_show_password}"}
    .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_password.$error.required}"}
      %label.col-md-2.control-label{"for" => "#{prefix}_password"}
        %div{"ng-show" => "vm.bChangeStoredPassword != true"}
          = password_label
        %div{"ng-show" => "vm.bChangeStoredPassword"}
          = new_password_label
      .col-md-4
        %input.form-control{"type"                    => "password",
                            "id"                      => "#{prefix}_password",
                            "ng-required"             => "#{ng_reqd_password}",
                            "ng-disabled"             => "!vm.showVerify('#{prefix}_userid')" || password_disabled,
                            "name"                    => "#{prefix}_password",
                            "ng-model"                => "#{main_scope}.#{ng_model}.#{prefix}_password",
                            "prefix"                  => "#{prefix}",
                            "clear-field-set-focus"   => "",
                            "checkchange"             => "",
                            "main-scope"              => "#{main_scope}",
                            "reset-validation-status" => "#{prefix}_auth_status"}
        %span.help-block{"ng-show" => "angularForm.#{prefix}_password.$error.required"}
          = _("Required")
      %div{"ng-if" => "vm.showChangePasswordLinks('#{prefix}_userid')"}
        %a{:href => "", "ng-hide" => "vm.bChangeStoredPassword", "ng-click" => "vm.changeStoredPassword()"}
          = change_stored_password
        %a{:href => "", "ng-show" => "vm.bChangeStoredPassword", "ng-click" => "vm.cancelPasswordChange()"}
          = cancel_password_change
  %div{"ng-show" => "#{ng_show}"}
    .form-group
      %label.col-md-2
      .col-md-4
        = render :partial => "layouts/angular/form_buttons_verify_angular",
                                     :locals  => {:ng_show          => "#{ng_show}",
                                                  :validate_url     => validate_url,
                                                  :id               => id,
                                                  :ng_model         => "#{ng_model}",<commit_msg>Provision for a use case where Validate btn should not be rendered<commit_after>- ng_show                ||= true
- validate_url           ||= 'log_depot_edit'
- prefix                 ||= 'log'
- userid_label           ||= _("Username")
- password_label         ||= _("Password")
- new_password_label     ||= _("<PASSWORD> ") + password_label
- ng_reqd_userid         ||= false
- ng_reqd_password       ||= false
- userid_disabled        ||= false
- password_disabled      ||= false
- change_stored_password ||= _("<PASSWORD>")
- cancel_password_change ||= _("Cancel password change")
- verify_title_off       ||= _("Server information, Username and matching password fields are needed to perform verification of credentials")
- ng_show_userid         ||= true
- ng_show_password       ||= true
- guid_regex             ||= false
- vm_scope               ||= false
- validate_button        ||= true
- main_scope            = vm_scope ? "$parent.vm" : "$parent"

%div{"ng-controller" => "CredentialsController as vm", "vm-scope" => "$parent.vm.model ? $parent.vm : $parent"}
  %div{"ng-show" => "#{ng_show} && #{ng_show_userid}"}
    .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_userid.$invalid}"}
      %label.col-md-2.control-label{"for" => "#{prefix}_userid"}
        = userid_label
      .col-md-4
        - hash_for_userid = {"type"                    => "text",
                             "id"                      => "#{prefix}_userid",
                             "ng-required"             => "#{ng_reqd_userid}",
                             "ng-disabled"             => userid_disabled,
                             "name"                    => "#{prefix}_userid",
                             "ng-model"                => "#{main_scope}.#{ng_model}.#{prefix}_userid",
                             "checkchange"             => "",
                             "ng-trim"                 => false,
                             "detect_spaces"           => "",
                             "prefix"                  => "#{prefix}",
                             "main-scope"              => "#{main_scope}",
                             "reset-validation-status" => "#{prefix}_auth_status"}
        - hash_for_userid['is-uuid'] = 4 if guid_regex
        %input.form-control{hash_for_userid}
        %span.help-block{"ng-show" => "angularForm.#{prefix}_userid.$error.required"}
          = _("Required")
        %span.help-block{"ng-show" => "angularForm.#{prefix}_userid.$error.detectedSpaces"}
          = _("Spaces are prohibited")
        %span.help-block{"ng-show" => "angularForm.#{prefix}_userid.$error.isUuid"}
          = _("Invalid input format, please enter a GUID")
        .note{"ng-if" => "emsCommonModel.emstype == 'scvmm' && emsCommonModel.default_security_protocol == 'kerberos'"}
          = _("Note: Username must be in the format: name@realm")

  %div{"ng-show" => "#{ng_show} && #{ng_show_password}"}
    .form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_password.$error.required}"}
      %label.col-md-2.control-label{"for" => "#{prefix}_password"}
        %div{"ng-show" => "vm.bChangeStoredPassword != true"}
          = password_label
        %div{"ng-show" => "vm.bChangeStoredPassword"}
          = new_password_label
      .col-md-4
        %input.form-control{"type"                    => "password",
                            "id"                      => "#{prefix}_password",
                            "ng-required"             => "#{ng_reqd_password}",
                            "ng-disabled"             => "!vm.showVerify('#{prefix}_userid')" || password_disabled,
                            "name"                    => "#{prefix}_password",
                            "ng-model"                => "#{main_scope}.#{ng_model}.#{prefix}_password",
                            "prefix"                  => "#{prefix}",
                            "clear-field-set-focus"   => "",
                            "checkchange"             => "",
                            "main-scope"              => "#{main_scope}",
                            "reset-validation-status" => "#{prefix}_auth_status"}
        %span.help-block{"ng-show" => "angularForm.#{prefix}_password.$error.required"}
          = _("Required")
      %div{"ng-if" => "vm.showChangePasswordLinks('#{prefix}_userid')"}
        %a{:href => "", "ng-hide" => "vm.bChangeStoredPassword", "ng-click" => "vm.changeStoredPassword()"}
          = change_stored_password
        %a{:href => "", "ng-show" => "vm.bChangeStoredPassword", "ng-click" => "vm.cancelPasswordChange()"}
          = cancel_password_change
  %div{"ng-show" => "#{ng_show}", "ng-if" => "#{validate_button}"}
    .form-group
      %label.col-md-2
      .col-md-4
        = render :partial => "layouts/angular/form_buttons_verify_angular",
                                     :locals  => {:ng_show          => "#{ng_show}",
                                                  :validate_url     => validate_url,
                                                  :id               => id,
                                                  :ng_model         => "#{ng_model}",
{'fraction_non_alphanumeric': 0.16119257086999023, 'fraction_numerical': 0.0013685239491691105, 'mean_word_length': 1.5324257425742573, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 112, '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': '2896378', 'n_tokens_mistral': 2848, 'n_tokens_neox': 2838, 'n_words': 418}