new.html.haml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. - content_for :page_title do
  2. = t('auth.register')
  3. - content_for :header_tags do
  4. = render partial: 'shared/og'
  5. = simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
  6. = render 'shared/error_messages', object: resource
  7. - if @invite.present? && @invite.autofollow?
  8. .fields-group{ style: 'margin-bottom: 30px' }
  9. %p.hint{ style: 'text-align: center' }= t('invites.invited_by')
  10. = render 'application/card', account: @invite.user.account
  11. = f.simple_fields_for :account do |ff|
  12. .fields-group
  13. = ff.input :username, wrapper: :with_label, autofocus: true, label: t('simple_form.labels.defaults.username'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off' }, append: "@#{site_hostname}", hint: t('simple_form.hints.defaults.username', domain: site_hostname)
  14. .fields-group
  15. = f.input :email, wrapper: :with_label, label: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off' }
  16. .fields-group
  17. = f.input :password, wrapper: :with_label, label: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }
  18. .fields-group
  19. = f.input :password_confirmation, wrapper: :with_label, label: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }
  20. - if approved_registrations? && !@invite.present?
  21. .fields-group
  22. = f.simple_fields_for :invite_request do |invite_request_fields|
  23. = invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: false
  24. = f.input :invite_code, as: :hidden
  25. .fields-group
  26. = f.input :agreement, as: :boolean, wrapper: :with_label, label: whitelist_mode? ? t('auth.checkbox_agreement_without_rules_html', terms_path: terms_path) : t('auth.checkbox_agreement_html', rules_path: about_more_path, terms_path: terms_path)
  27. .actions
  28. = f.button :button, @invite.present? ? t('auth.register') : sign_up_message, type: :submit
  29. .form-footer= render 'auth/shared/links'