<commit_before>#login-screen{:class =>"#{get_vmdb_config[:server][:custom_login_logo] ? 'whitelabel' : ''}"}
  %img#logo{:src => "#{session[:custom_logo] ? '/upload/custom_logo.png' : image_path("layout/login-screen-logo.png")}"}
  .form
    = render(:partial => "layouts/spinner", :locals => {:login => true})
    #flash_div{:style =>"#{flash[:notice] ? "" : "display:none"}"}
      #{flash[:notice]}
    %fieldset
      %legend
        %img{:src => image_path("layout/product-name.png")}
      #login_div
        %p
          %label=_('Username')
          = text_field_tag('user_name', @user_name,:onkeypress => "if(miqEnterPressed(event)) miqAjaxAuth();")
          = javascript_tag(javascript_focus('user_name'))
        %p
          %label=_('Password')
          = password_field_tag('user_password',
            <PASSWORD>password,
            :onkeypress => "if(miqEnterPressed(event)) miqAjaxAuth();",
            :autocomplete => "off")

        - if User.mode == 'database'
          = render :partial => 'login_more'

        -# Fields collected via JS functions, sent up with credentials
        %input{:type => "hidden", :id => "browser_name", :name => "browser_name"}
        %input{:type => "hidden", :id => "browser_version", :name => "browser_version"}
        %input{:type => "hidden", :id => "browser_os", :name => "browser_os"}
        %input{:type => "hidden", :id => "user_TZO", :name => "user_TZO"}

      %ul.login_buttons
        %li
          = link_to({:action => "authenticate", :button => "login", :method => :post},
            "data-miq_sparkle_on" => true,
            "data-submit" => 'login_div',
            :remote => true,
            :id => "login",
            :class => "button",
            :title => _("Login")) { _("Log In") }
          = link_to({:action => "kerberos_authenticate", :button => "sso_login", :method => :post},
            "data-miq_sparkle_on" => true,
            "data-miq_login_error" => true,
            "data-submit" => 'login_div',
            :remote => true,
            :id => "sso_login",
            :class => "button",
            :hidden => true,
            :title => _("SSO Login")) { _("SSO Log In") }

        - if User.mode == "database"
          %li#back_button{:style => "display:none"}
            = link_to({:action => "authenticate", :button => "back", :method => :post},
              :remote => true,
              :title => _("Back")) { _("Back") }
          %li#more_button
            = link_to({:action => "authenticate", :button => "more", :method => :post},
            :remote => true,
            :title => _("Update Password")) { _("Update password") }
    - if get_vmdb_config[:session][:show_login_info]
      %aside
        %p
          =_('Region:')
          %span
            = (MiqRegion.my_region.description)
        %p
          =_('Zone:')
          %span
            = (MiqServer.my_zone)
        %p
          =_('Appliance:')
          %span
            = (MiqServer.my_server.name)
        %p.message
          - if get_vmdb_config[:server][:use_custom_login_text]
            = (get_vmdb_config[:server][:custom_login_text].to_s)

= javascript_include_tag 'miq_browser_detect.js'
:javascript
  miqGetTZO();
  miqGetBrowserInfo();
  miqGetBrowserSize();
  miqClearTreeState();

- auto_login  = session[:auto_login]  # Set to false via dashboard/logout
- auth_mode   = get_vmdb_config[:authentication][:mode]
- sso_enabled = get_vmdb_config[:authentication][:sso_enabled]
- session[:auto_login] = true
- if auth_mode == "httpd" && sso_enabled
  - if auto_login != false
    :javascript
      var miq_after_onload = "$('sso_login').click()";
- elsif @user_name  # If user name is pre-populated by the server, press the Login button automatically
  :javascript
    var miq_after_onload = "$('login').click()";
<commit_msg>Convert click function calls from prototype to jquery<commit_after>#login-screen{:class =>"#{get_vmdb_config[:server][:custom_login_logo] ? 'whitelabel' : ''}"}
  %img#logo{:src => "#{session[:custom_logo] ? '/upload/custom_logo.png' : image_path("layout/login-screen-logo.png")}"}
  .form
    = render(:partial => "layouts/spinner", :locals => {:login => true})
    #flash_div{:style =>"#{flash[:notice] ? "" : "display:none"}"}
      #{flash[:notice]}
    %fieldset
      %legend
        %img{:src => image_path("layout/product-name.png")}
      #login_div
        %p
          %label=_('Username')
          = text_field_tag('user_name', @user_name,:onkeypress => "if(miqEnterPressed(event)) miqAjaxAuth();")
          = javascript_tag(javascript_focus('user_name'))
        %p
          %label=_('Password')
          = password_field_tag('user_password',
            <PASSWORD>,
            :onkeypress => "if(miqEnterPressed(event)) miqAjaxAuth();",
            :autocomplete => "off")

        - if User.mode == 'database'
          = render :partial => 'login_more'

        -# Fields collected via JS functions, sent up with credentials
        %input{:type => "hidden", :id => "browser_name", :name => "browser_name"}
        %input{:type => "hidden", :id => "browser_version", :name => "browser_version"}
        %input{:type => "hidden", :id => "browser_os", :name => "browser_os"}
        %input{:type => "hidden", :id => "user_TZO", :name => "user_TZO"}

      %ul.login_buttons
        %li
          = link_to({:action => "authenticate", :button => "login", :method => :post},
            "data-miq_sparkle_on" => true,
            "data-submit" => 'login_div',
            :remote => true,
            :id => "login",
            :class => "button",
            :title => _("Login")) { _("Log In") }
          = link_to({:action => "kerberos_authenticate", :button => "sso_login", :method => :post},
            "data-miq_sparkle_on" => true,
            "data-miq_login_error" => true,
            "data-submit" => 'login_div',
            :remote => true,
            :id => "sso_login",
            :class => "button",
            :hidden => true,
            :title => _("SSO Login")) { _("SSO Log In") }

        - if User.mode == "database"
          %li#back_button{:style => "display:none"}
            = link_to({:action => "authenticate", :button => "back", :method => :post},
              :remote => true,
              :title => _("Back")) { _("Back") }
          %li#more_button
            = link_to({:action => "authenticate", :button => "more", :method => :post},
            :remote => true,
            :title => _("Update Password")) { _("Update password") }
    - if get_vmdb_config[:session][:show_login_info]
      %aside
        %p
          =_('Region:')
          %span
            = (MiqRegion.my_region.description)
        %p
          =_('Zone:')
          %span
            = (MiqServer.my_zone)
        %p
          =_('Appliance:')
          %span
            = (MiqServer.my_server.name)
        %p.message
          - if get_vmdb_config[:server][:use_custom_login_text]
            = (get_vmdb_config[:server][:custom_login_text].to_s)

= javascript_include_tag 'miq_browser_detect.js'
:javascript
  miqGetTZO();
  miqGetBrowserInfo();
  miqGetBrowserSize();
  miqClearTreeState();

- auto_login  = session[:auto_login]  # Set to false via dashboard/logout
- auth_mode   = get_vmdb_config[:authentication][:mode]
- sso_enabled = get_vmdb_config[:authentication][:sso_enabled]
- session[:auto_login] = true
- if auth_mode == "httpd" && sso_enabled
  - if auto_login != false
    :javascript
      var miq_after_onload = "$j('#sso_login').click()";
- elsif @user_name  # If user name is pre-populated by the server, press the Login button automatically
  :javascript
    var miq_after_onload = "$j('#login').click()";

{'fraction_non_alphanumeric': 0.17485061054819434, 'fraction_numerical': 0.0, 'mean_word_length': 2.547926267281106, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '810833', 'n_tokens_mistral': 2535, 'n_tokens_neox': 2481, 'n_words': 455}