- submit_btn_text ||= 'Sign Up'

- if ::Configuration.proxy_auth_mode_enabled?
  - if CONFIG['proxy_auth_register_page'].blank?
    %p Sorry, signing up is currently disabled
  - else
    %p= link_to 'Use this link to Sign Up', CONFIG['proxy_auth_register_page']
- else
  = form_tag(users_path, method: :post, class: 'sign-up', autocomplete: 'off') do
    .mb-3
      = label_tag 'login', 'Username:'
      = render partial: 'webui/shared/required_label_mark'
      = text_field_tag 'login', nil, placeholder: 'Username', autocomplete: 'off', class: 'form-control', required: true
    .mb-3
      = label_tag 'email', 'Email:'
      = render partial: 'webui/shared/required_label_mark'
      = text_field_tag 'email', nil, placeholder: 'Email address', autocomplete: 'off', class: 'form-control', type: 'email', required: true
    .mb-3
      = label_tag 'password', 'Password:'
      = render partial: 'webui/shared/required_label_mark'
      = password_field_tag :password, nil, id: 'pwd', placeholder: 'Enter a password', autocomplete: 'off', class: 'form-control', required: true
    .mb-3
      = label_tag 'password_confirmation', 'Password confirmation:'
      = render partial: 'webui/shared/required_label_mark'
      = password_field_tag(:password_confirmation, nil, id: 'pwd_confirmation', placeholder: 'Password confirmation', autocomplete: 'off',
        class: 'form-control', required: true)
    = hidden_field_tag 'register', 'true'
    = submit_tag submit_btn_text, class: 'btn btn-primary w-100'

    -# This should be refactored to avoid relying on global state
    - unless User.session # rubocop:disable ViewComponent/AvoidGlobalState
      .login-separator.text-center
        %hr.my-4
        %span.bg-card.px-3.text-muted or
      .text-center
        = link_to('Log In', new_session_path)
