diff options
Diffstat (limited to 'app/views/devise/sessions')
-rw-r--r-- | app/views/devise/sessions/_new_base.html.haml | 34 | ||||
-rw-r--r-- | app/views/devise/sessions/_new_base_user_login_label.html.haml | 1 | ||||
-rw-r--r-- | app/views/devise/sessions/_new_crowd.html.haml | 29 | ||||
-rw-r--r-- | app/views/devise/sessions/_new_ldap.html.haml | 25 | ||||
-rw-r--r-- | app/views/devise/sessions/email_verification.haml | 4 | ||||
-rw-r--r-- | app/views/devise/sessions/two_factor.html.haml | 35 |
6 files changed, 64 insertions, 64 deletions
diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index 698e8c89a08..4825f192d4d 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -1,31 +1,27 @@ -= gitlab_ui_form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'new_user gl-show-field-errors js-arkose-labs-form', aria: { live: 'assertive' }, data: { testid: 'sign-in-form' }}) do |f| - .form-group.gl-px-5.gl-pt-5 - = render_if_exists 'devise/sessions/new_base_user_login_label', form: f - = f.text_field :login, value: @invite_email, class: 'form-control gl-form-input top js-username-field', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', required: true, title: _('This field is required.'), data: { qa_selector: 'login_field', testid: 'username-field' } - .form-group.gl-px-5 - = f.label :password, class: "label-bold #{'gl-mb-1' if Feature.enabled?(:restyle_login_page, @project)}" += gitlab_ui_form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'gl-p-5 gl-show-field-errors js-arkose-labs-form', aria: { live: 'assertive' }, data: { testid: 'sign-in-form' }}) do |f| + .form-group + = f.label :login, _('Username or email') + = f.text_field :login, value: @invite_email, class: 'form-control gl-form-input js-username-field', autocomplete: 'username', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', required: true, title: _('This field is required.'), data: { qa_selector: 'login_field', testid: 'username-field' } + .form-group + = f.label :password, _('Password') = f.password_field :password, class: 'form-control gl-form-input js-password', data: { id: "#{resource_name}_password", qa_selector: 'password_field', testid: 'password-field', name: "#{resource_name}[password]" } - .gl-px-5 - .gl-display-inline-block - - if remember_me_enabled? - = f.gitlab_ui_checkbox_component :remember_me, _('Remember me') - .gl-float-right + .form-text.gl-text-right - if unconfirmed_email? = link_to _('Resend confirmation email'), new_user_confirmation_path - else = link_to _('Forgot your password?'), new_password_path(:user) - %div + + .form-group - if Feature.enabled?(:arkose_labs_login_challenge) = render_if_exists 'devise/sessions/arkose_labs' - elsif captcha_enabled? || captcha_on_login_required? - .gl-px-5 - = recaptcha_tags nonce: content_security_policy_nonce + = recaptcha_tags nonce: content_security_policy_nonce + + - if remember_me_enabled? + = f.gitlab_ui_checkbox_component :remember_me, _('Remember me'), checkbox_options: { autocomplete: 'off' } - .submit-container.move-submit-down.gl-px-5.gl-pb-5 - = f.button _('Sign in'), type: :submit, class: "gl-button btn btn-block btn-confirm js-sign-in-button#{' js-no-auto-disable' if Feature.enabled?(:arkose_labs_login_challenge)}", data: { qa_selector: 'sign_in_button', testid: 'sign-in-button' } - - if Gitlab::CurrentSettings.sign_in_text.present? && Feature.enabled?(:restyle_login_page, @project) - .gl-px-5 - = markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text) + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { class: "js-sign-in-button #{'js-no-auto-disable' if Feature.enabled?(:arkose_labs_login_challenge)}", data: { qa_selector: 'sign_in_button', testid: 'sign-in-button' } }) do + = _('Sign in') diff --git a/app/views/devise/sessions/_new_base_user_login_label.html.haml b/app/views/devise/sessions/_new_base_user_login_label.html.haml deleted file mode 100644 index 8a8b9f7a361..00000000000 --- a/app/views/devise/sessions/_new_base_user_login_label.html.haml +++ /dev/null @@ -1 +0,0 @@ -= local_assigns[:form].label _('Username or email'), for: 'user_login', class: "label-bold #{'gl-mb-1' if Feature.enabled?(:restyle_login_page, @project)}" diff --git a/app/views/devise/sessions/_new_crowd.html.haml b/app/views/devise/sessions/_new_crowd.html.haml index 293e287371a..bb398eaf4be 100644 --- a/app/views/devise/sessions/_new_crowd.html.haml +++ b/app/views/devise/sessions/_new_crowd.html.haml @@ -1,13 +1,16 @@ -= form_tag(omniauth_authorize_path(:user, :crowd), id: 'new_crowd_user', class: 'gl-show-field-errors') do - .form-group.gl-px-5.gl-pt-5 - = label_tag :username, _('Username or email') - = text_field_tag :username, nil, { class: "form-control top", title: _("This field is required."), autofocus: "autofocus", required: true } - .form-group.gl-px-5 - = label_tag :password - = password_field_tag :password, nil, { class: 'form-control gl-form-input js-password', data: { id: 'password', name: 'password' } } - - if remember_me_enabled? - .remember-me.gl-px-5 - %label{ for: "remember_me" } - = check_box_tag :remember_me, '1', false, id: 'remember_me' - %span= _('Remember me') - = submit_tag _("Sign in"), class: "gl-button btn-confirm btn gl-px-5" +- render_remember_me = remember_me_enabled? && local_assigns.fetch(:render_remember_me, true) +- submit_message = local_assigns.fetch(:submit_message, _('Sign in')) + += gitlab_ui_form_for(:crowd, url: omniauth_authorize_path(:user, :crowd), html: { class: 'gl-p-5 gl-show-field-errors', aria: { live: 'assertive' }, data: { testid: 'new_crowd_user' }}) do |f| + .form-group + = f.label :username, _('Username or email') + = f.text_field :username, name: :username, autocomplete: :username, class: 'form-control gl-form-input', title: _('This field is required.'), autofocus: 'autofocus', required: true + .form-group + = f.label :password, _('Password') + = f.text_field :vue_password_placeholder, class: 'form-control gl-form-input js-password', data: { id: "#{:crowd}_password", name: 'password' } + + - if render_remember_me + = f.gitlab_ui_checkbox_component :remember_me, _('Remember me'), checkbox_options: { name: :remember_me, autocomplete: 'off' } + + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true) do + = submit_message diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index fb5a57b509c..f9b6f462661 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -1,19 +1,18 @@ - server = local_assigns.fetch(:server) +- provider = server['provider_name'] - render_remember_me = remember_me_enabled? && local_assigns.fetch(:render_remember_me, true) - submit_message = local_assigns.fetch(:submit_message, _('Sign in')) -= form_tag(omniauth_callback_path(:user, server['provider_name']), id: 'new_ldap_user', class: "gl-show-field-errors") do - .form-group.gl-px-5.gl-pt-5 - = label_tag :username, "#{server['label']} Username" - = text_field_tag :username, nil, { class: "form-control gl-form-input top", title: _("This field is required."), autofocus: "autofocus", data: { qa_selector: 'username_field' }, required: true } - .form-group.gl-px-5 - = label_tag :password - = password_field_tag :password, nil, { class: 'form-control gl-form-input js-password', data: { id: 'password', name: 'password', qa_selector: 'password_field' } } += gitlab_ui_form_for(provider, url: omniauth_callback_path(:user, provider), html: { class: 'gl-p-5 gl-show-field-errors', aria: { live: 'assertive' }, data: { testid: 'new_ldap_user' }}) do |f| + .form-group + = f.label :username, _('Username') + = f.text_field :username, name: :username, autocomplete: :username, class: 'form-control gl-form-input', title: _('This field is required.'), autofocus: 'autofocus', data: { qa_selector: 'username_field' }, required: true + .form-group + = f.label :password, _('Password') + = f.text_field :vue_password_placeholder, class: 'form-control gl-form-input js-password', data: { id: "#{provider}_password", name: 'password', qa_selector: 'password_field' } + - if render_remember_me - .gl-px-5 - = render Pajamas::CheckboxTagComponent.new(name: 'remember_me') do |c| - = c.label do - = _('Remember me') + = f.gitlab_ui_checkbox_component :remember_me, _('Remember me'), checkbox_options: { name: :remember_me, autocomplete: 'off' } - .submit-container.move-submit-down.gl-px-5.gl-pb-5 - = submit_tag submit_message, class: "gl-button btn btn-confirm", data: { qa_selector: 'sign_in_button' } + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { qa_selector: 'sign_in_button' } }) do + = submit_message diff --git a/app/views/devise/sessions/email_verification.haml b/app/views/devise/sessions/email_verification.haml index 6cafcb941b4..e0b5a266961 100644 --- a/app/views/devise/sessions/email_verification.haml +++ b/app/views/devise/sessions/email_verification.haml @@ -2,7 +2,7 @@ = render 'devise/shared/tab_single', tab_title: s_('IdentityVerification|Help us protect your account') .login-box.gl-p-5 .login-body - = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post, html: { class: 'gl-show-field-errors' }) do |f| + = gitlab_ui_form_for(resource, as: resource_name, url: session_path(resource_name), method: :post, html: { class: 'gl-show-field-errors' }) do |f| %p = s_("IdentityVerification|For added security, you'll need to verify your identity. We've sent a verification code to %{email}").html_safe % { email: "<strong>#{sanitize(obfuscated_email(resource.email))}</strong>".html_safe } %div @@ -11,7 +11,7 @@ %p.gl-field-error.gl-mt-2 = resource.errors.full_messages.to_sentence .gl-mt-5 - = f.submit s_('IdentityVerification|Verify code'), class: 'gl-button btn btn-confirm' + = f.submit s_('IdentityVerification|Verify code'), class: 'gl-w-full', pajamas_button: true - unless send_rate_limited?(resource) = link_to s_('IdentityVerification|Resend code'), users_resend_verification_code_path, method: :post, class: 'form-control gl-button btn-link gl-mt-3 gl-mb-0' %p.gl-p-5.gl-text-secondary diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml index 06152e3dac5..e3457040e6c 100644 --- a/app/views/devise/sessions/two_factor.html.haml +++ b/app/views/devise/sessions/two_factor.html.haml @@ -1,17 +1,20 @@ -%div - = render 'devise/shared/tab_single', tab_title: _('Two-Factor Authentication') if Feature.disabled?(:restyle_login_page, @project) - .login-box.gl-p-5 - .login-body - - if @user.two_factor_enabled? - = gitlab_ui_form_for(resource, as: resource_name, url: session_path(resource_name), method: :post, html: { class: "edit_user gl-show-field-errors js-2fa-form #{'hidden' if @user.two_factor_webauthn_enabled?}" }) do |f| += render 'devise/shared/tab_single', tab_title: _('Two-factor authentication') if Feature.disabled?(:restyle_login_page, @project) +.login-box.gl-p-5 + .login-body + - if @user.two_factor_enabled? + = gitlab_ui_form_for(resource, as: resource_name, url: session_path(resource_name), method: :post, html: { class: "edit_user gl-show-field-errors js-2fa-form #{'hidden' if @user.two_factor_webauthn_enabled?}" }) do |f| + .form-group + = f.label :otp_attempt, _('Enter verification code') + = f.text_field :otp_attempt, class: 'form-control gl-form-input', required: true, autofocus: true, autocomplete: 'off', inputmode: 'numeric', title: _('This field is required.'), data: { qa_selector: 'two_fa_code_field' } + %p.form-text.text-muted.hint + = _("Enter the code from your two-factor authenticator app. If you've lost your device, you can enter one of your recovery codes.") + + - if remember_me_enabled? - resource_params = params[resource_name].presence || params - - if remember_me_enabled? - = f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0) - %div - = f.label _('Enter verification code'), name: :otp_attempt, class: Feature.enabled?(:restyle_login_page, @project) ? 'gl-mb-1' : '' - = f.text_field :otp_attempt, class: 'form-control gl-form-input', required: true, autofocus: true, autocomplete: 'off', inputmode: 'numeric', title: _('This field is required.'), data: { qa_selector: 'two_fa_code_field' } - %p.form-text.text-muted.hint= _("Enter the code from your two-factor authenticator app. If you've lost your device, you can enter one of your recovery codes.") - .prepend-top-20 - = f.submit _("Verify code"), pajamas_button: true, data: { qa_selector: 'verify_code_button' } - - if @user.two_factor_webauthn_enabled? - = render "authentication/authenticate", params: params, resource: resource, resource_name: resource_name, render_remember_me: true, target_path: new_user_session_path + = f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0) + + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { qa_selector: 'verify_code_button' } }) do + = _("Verify code") + + - if @user.two_factor_webauthn_enabled? + = render "authentication/authenticate", params: params, resource: resource, resource_name: resource_name, render_remember_me: true, target_path: new_user_session_path |