debian-mirror-gitlab/app/views/devise/shared/_signup_box.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
5.2 KiB
Text
Raw Normal View History

2021-01-03 14:25:43 +05:30
- max_first_name_length = max_last_name_length = 127
2021-02-22 17:27:13 +05:30
- omniauth_providers_placement ||= :bottom
2022-04-04 11:22:00 +05:30
- borderless ||= false
2023-06-20 00:43:36 +05:30
- form_resource_name = "new_#{resource_name}"
2021-02-22 17:27:13 +05:30
2022-04-04 11:22:00 +05:30
.gl-mb-3.gl-p-4{ class: (borderless ? '' : 'gl-border-gray-100 gl-border-1 gl-border-solid gl-rounded-base') }
2021-02-22 17:27:13 +05:30
- if show_omniauth_providers && omniauth_providers_placement == :top
= render 'devise/shared/signup_omniauth_providers_top'
2023-06-20 00:43:36 +05:30
= gitlab_ui_form_for(resource, as: form_resource_name, url: url, html: { class: 'new_user gl-show-field-errors js-arkose-labs-form', 'aria-live' => 'assertive' }, data: { testid: 'signup-form' }) do |f|
2021-01-29 00:20:46 +05:30
.devise-errors
= render 'devise/shared/error_messages', resource: resource
2021-03-08 18:12:59 +05:30
- if Gitlab::CurrentSettings.invisible_captcha_enabled
2021-09-04 01:27:46 +05:30
= invisible_captcha nonce: true, autocomplete: SecureRandom.alphanumeric(12)
2021-01-29 00:20:46 +05:30
.name.form-row
.col.form-group
2022-08-27 11:52:29 +05:30
= f.label :first_name, _('First name'), for: 'new_user_first_name', class: "label-bold #{'gl-mb-1' if Feature.enabled?(:restyle_login_page, @project)}"
2021-09-04 01:27:46 +05:30
= f.text_field :first_name,
class: 'form-control gl-form-input top js-block-emoji js-validate-length',
data: { max_length: max_first_name_length,
max_length_message: s_('SignUp|First name is too long (maximum is %{max_length} characters).') % { max_length: max_first_name_length },
qa_selector: 'new_user_first_name_field' },
required: true,
title: _('This field is required.')
2021-01-29 00:20:46 +05:30
.col.form-group
2022-08-27 11:52:29 +05:30
= f.label :last_name, _('Last name'), for: 'new_user_last_name', class: "label-bold #{'gl-mb-1' if Feature.enabled?(:restyle_login_page, @project)}"
2021-09-04 01:27:46 +05:30
= f.text_field :last_name,
class: 'form-control gl-form-input top js-block-emoji js-validate-length',
data: { max_length: max_last_name_length,
max_length_message: s_('SignUp|Last name is too long (maximum is %{max_length} characters).') % { max_length: max_last_name_length },
qa_selector: 'new_user_last_name_field' },
required: true,
title: _('This field is required.')
2021-01-29 00:20:46 +05:30
.username.form-group
2022-08-27 11:52:29 +05:30
= f.label :username, class: "label-bold #{'gl-mb-1' if Feature.enabled?(:restyle_login_page, @project)}"
2021-09-04 01:27:46 +05:30
= f.text_field :username,
class: 'form-control gl-form-input middle js-block-emoji js-validate-length js-validate-username',
data: signup_username_data_attributes,
pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS,
required: true,
title: _('Please create a username with only alphanumeric characters.')
2021-01-29 00:20:46 +05:30
%p.validation-error.gl-text-red-500.gl-field-error-ignore.gl-mt-2.field-validation.hide= _('Username is already taken.')
%p.validation-success.gl-text-green-600.gl-field-error-ignore.gl-mt-2.field-validation.hide= _('Username is available.')
%p.validation-pending.gl-field-error-ignore.gl-mt-2.field-validation.hide= _('Checking username availability...')
.form-group
2022-08-27 11:52:29 +05:30
= f.label :email, class: "label-bold #{'gl-mb-1' if Feature.enabled?(:restyle_login_page, @project)}"
2021-09-04 01:27:46 +05:30
= f.email_field :email,
2022-08-13 15:12:31 +05:30
class: 'form-control gl-form-input middle js-validate-email',
2021-09-04 01:27:46 +05:30
data: { qa_selector: 'new_user_email_field' },
required: true,
title: _('Please provide a valid email address.')
2022-08-27 11:52:29 +05:30
%p.validation-hint.gl-field-hint.text-secondary= _('We recommend a work email address.')
%p.validation-warning.gl-field-error-ignore.text-secondary.hide= _('This email address does not look right, are you sure you typed it correctly?')
2022-08-13 15:12:31 +05:30
-# This is used for providing entry to Jihu on email verification
= render_if_exists 'devise/shared/signup_email_additional_info'
2023-06-20 00:43:36 +05:30
.form-group.gl-mb-5
2022-08-27 11:52:29 +05:30
= f.label :password, class: "label-bold #{'gl-mb-1' if Feature.enabled?(:restyle_login_page, @project)}"
2023-07-09 08:55:56 +05:30
%input.form-control.gl-form-input.js-password{ data: { id: "#{form_resource_name}_password",
title: s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length },
2023-06-20 00:43:36 +05:30
minimum_password_length: @minimum_password_length,
2023-07-09 08:55:56 +05:30
qa_selector: 'new_user_password_field',
autocomplete: 'new-password',
name: "#{form_resource_name}[password]" } }
2023-06-20 00:43:36 +05:30
%p.gl-field-hint-valid.text-secondary= s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length }
2022-08-13 15:12:31 +05:30
= render_if_exists 'shared/password_requirements_list'
2021-11-11 11:23:49 +05:30
= render_if_exists 'devise/shared/phone_verification', form: f
2021-01-29 00:20:46 +05:30
%div
2022-10-11 01:57:18 +05:30
2023-05-27 22:25:52 +05:30
- if arkose_labs_enabled?
2022-10-11 01:57:18 +05:30
= render_if_exists 'devise/registrations/arkose_labs'
- elsif show_recaptcha_sign_up?
2021-06-08 01:23:25 +05:30
= recaptcha_tags nonce: content_security_policy_nonce
2022-10-11 01:57:18 +05:30
2022-03-02 08:16:31 +05:30
.submit-container.gl-mt-5
2023-03-17 16:20:25 +05:30
= f.submit button_text, pajamas_button: true, class: 'gl-w-full', data: { qa_selector: 'new_user_register_button' }
2022-08-27 11:52:29 +05:30
- if Gitlab::CurrentSettings.sign_in_text.present? && Feature.enabled?(:restyle_login_page, @project)
.gl-pt-5
= markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text)
2021-06-08 01:23:25 +05:30
= render 'devise/shared/terms_of_service_notice', button_text: button_text
2021-02-22 17:27:13 +05:30
- if show_omniauth_providers && omniauth_providers_placement == :bottom
2021-01-29 00:20:46 +05:30
= render 'devise/shared/signup_omniauth_providers'