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

43 lines
4 KiB
Text
Raw Normal View History

2021-01-03 14:25:43 +05:30
- max_first_name_length = max_last_name_length = 127
2019-09-04 21:01:54 +05:30
- max_username_length = 255
2020-07-28 23:09:34 +05:30
- min_username_length = 2
2021-02-22 17:27:13 +05:30
- omniauth_providers_placement ||= :bottom
2021-01-29 00:20:46 +05:30
.gl-mb-3.gl-p-4.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'
2021-01-29 00:20:46 +05:30
= form_for(resource, as: "new_#{resource_name}", url: url, html: { class: 'new_user gl-show-field-errors', 'aria-live' => 'assertive' }) do |f|
.devise-errors
= render 'devise/shared/error_messages', resource: resource
2021-03-08 18:12:59 +05:30
- if Gitlab::CurrentSettings.invisible_captcha_enabled
2021-01-29 00:20:46 +05:30
= invisible_captcha
.name.form-row
.col.form-group
= f.label :first_name, _('First name'), for: 'new_user_first_name', class: 'label-bold'
2021-03-11 19:13:27 +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
= f.label :last_name, _('Last name'), for: 'new_user_last_name', class: 'label-bold'
2021-03-11 19:13:27 +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
= f.label :username, class: 'label-bold'
2021-03-11 19:13:27 +05:30
= f.text_field :username, class: 'form-control gl-form-input middle js-block-emoji js-validate-length js-validate-username', :data => { :api_path => suggestion_path, :min_length => min_username_length, :min_length_message => s_('SignUp|Username is too short (minimum is %{min_length} characters).') % { min_length: min_username_length }, :max_length => max_username_length, :max_length_message => s_('SignUp|Username is too long (maximum is %{max_length} characters).') % { max_length: max_username_length }, :qa_selector => 'new_user_username_field' }, 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
= f.label :email, class: 'label-bold'
2021-03-11 19:13:27 +05:30
= f.email_field :email, value: @invite_email, class: 'form-control gl-form-input middle', data: { qa_selector: 'new_user_email_field' }, required: true, title: _('Please provide a valid email address.')
2021-02-22 17:27:13 +05:30
.form-group.gl-mb-5#password-strength
2021-01-29 00:20:46 +05:30
= f.label :password, class: 'label-bold'
2021-03-11 19:13:27 +05:30
= f.password_field :password, class: 'form-control gl-form-input bottom', data: { qa_selector: 'new_user_password_field' }, required: true, pattern: ".{#{@minimum_password_length},}", title: s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length }
2021-01-29 00:20:46 +05:30
%p.gl-field-hint.text-secondary= s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length }
%div
- if show_recaptcha_sign_up?
= recaptcha_tags
.submit-container
2021-04-17 20:07:23 +05:30
= f.submit button_text, class: 'btn gl-button btn-confirm', data: { qa_selector: 'new_user_register_button' }
2021-01-29 00:20:46 +05:30
= render 'devise/shared/terms_of_service_notice'
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'