Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_signup_box_form.html.haml « shared « devise « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2920aeecce0006ddc5b5dd911b520172e2332f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
- max_first_name_length = max_last_name_length = 127
- form_resource_name = "new_#{resource_name}"

= gitlab_ui_form_for(resource, as: form_resource_name, url: url, html: { class: 'gl-show-field-errors js-arkose-labs-form', aria: { live: 'assertive' }}, data: { testid: 'signup-form' }) do |f|
  .devise-errors
    = render 'devise/shared/error_messages', resource: resource
  - if Gitlab::CurrentSettings.invisible_captcha_enabled
    = invisible_captcha nonce: true, autocomplete: SecureRandom.alphanumeric(12)
  - if @invite_email.present?
    .form-group
      = f.label :email, _('Email'), class: 'gl-display-block'
      .gl-font-weight-bold{ 'data-testid': 'invite-email' }
        = @invite_email
      = f.hidden_field :email, value: @invite_email
      = hidden_field_tag :invite_email, @invite_email
  .name.form-row
    .col.form-group
      = f.label :first_name, _('First name'), for: 'new_user_first_name'
      = 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 },
        testid: 'new-user-first-name-field' },
        required: true,
        title: _('This field is required.')
    .col.form-group
      = f.label :last_name, _('Last name'), for: 'new_user_last_name'
      = 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 },
        testid: 'new-user-last-name-field' },
        required: true,
        title: _('This field is required.')
  .username.form-group
    = f.label :username, _('Username')
    = 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.')
    %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...')
  - unless @invite_email.present?
    .form-group
      = f.label :email, _('Email')
      = f.email_field :email,
        class: 'form-control gl-form-input middle js-validate-email',
        data: { testid: 'new-user-email-field' },
        required: true,
        title: _('Please provide a valid email address.')
      %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?')
      -# This is used for providing entry to Jihu on email verification
      = render_if_exists 'devise/shared/signup_email_additional_info'
  .form-group.gl-mb-5
    = f.label :password, _('Password')
    %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 },
      minimum_password_length: @minimum_password_length,
      testid: 'new-user-password-field',
      autocomplete: 'new-password',
      name: "#{form_resource_name}[password]" } }
    %p.gl-field-hint-valid.text-secondary= s_('SignUp|Minimum length is %{minimum_password_length} characters.') % { minimum_password_length: @minimum_password_length }
    = render_if_exists 'shared/password_requirements_list'
  = render_if_exists 'devise/shared/phone_verification', form: f

  .form-group
    - if arkose_labs_enabled?
      = render_if_exists 'devise/registrations/arkose_labs'
    - elsif show_recaptcha_sign_up?
      = recaptcha_tags nonce: content_security_policy_nonce

  = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, block: true, button_options: { data: { testid: 'new-user-register-button' }}) do
    = button_text

  = render 'devise/shared/terms_of_service_notice', button_text: button_text

= yield :omniauth_providers_bottom if show_omniauth_providers