This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add progress indicator to sign-up flow (mastodon#24545)
- Loading branch information
Showing
76 changed files
with
157 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
= render partial: 'shared/og', locals: { description: description_for_sign_up } | ||
|
||
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { novalidate: false }) do |f| | ||
= render 'auth/shared/progress', stage: 'details' | ||
|
||
%h1.title= t('auth.sign_up.title', domain: site_hostname) | ||
%p.lead= t('auth.sign_up.preamble') | ||
|
||
|
@@ -18,17 +20,19 @@ | |
.fields-group | ||
= f.simple_fields_for :account do |ff| | ||
= ff.input :display_name, wrapper: :with_label, label: false, required: false, input_html: { 'aria-label': t('simple_form.labels.defaults.display_name'), autocomplete: 'off', placeholder: t('simple_form.labels.defaults.display_name') } | ||
= ff.input :username, wrapper: :with_label, label: false, required: true, input_html: { 'aria-label': t('simple_form.labels.defaults.username'), autocomplete: 'off', placeholder: t('simple_form.labels.defaults.username'), pattern: '[a-zA-Z0-9_]+', maxlength: 30 }, append: "@#{site_hostname}", hint: false | ||
= ff.input :username, wrapper: :with_label, label: false, required: true, input_html: { 'aria-label': t('simple_form.labels.defaults.username'), autocomplete: 'off', placeholder: t('simple_form.labels.defaults.username'), pattern: '[a-zA-Z0-9_]+', maxlength: 30 }, append: "@#{site_hostname}" | ||
= f.input :email, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label': t('simple_form.labels.defaults.email'), autocomplete: 'username' }, hint: false | ||
= f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label': t('simple_form.labels.defaults.password'), autocomplete: 'new-password', minlength: User.password_length.first, maxlength: User.password_length.last }, hint: false | ||
= f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label': t('simple_form.labels.defaults.confirm_password'), autocomplete: 'new-password' }, hint: false | ||
= f.input :confirm_password, as: :string, placeholder: t('simple_form.labels.defaults.honeypot', label: t('simple_form.labels.defaults.password')), required: false, input_html: { 'aria-label': t('simple_form.labels.defaults.honeypot', label: t('simple_form.labels.defaults.password')), autocomplete: 'off' }, hint: false | ||
= f.input :website, as: :url, wrapper: :with_label, label: t('simple_form.labels.defaults.honeypot', label: 'Website'), required: false, input_html: { 'aria-label': t('simple_form.labels.defaults.honeypot', label: 'Website'), autocomplete: 'off' } | ||
|
||
- if approved_registrations? && [email protected]? | ||
%p.lead= t('auth.sign_up.manual_review', domain: site_hostname) | ||
|
||
.fields-group | ||
= f.simple_fields_for :invite_request, resource.invite_request || resource.build_invite_request do |invite_request_fields| | ||
= invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: Setting.require_invite_text | ||
= invite_request_fields.input :text, as: :text, wrapper: :with_block_label, required: Setting.require_invite_text, label: false, hint: false | ||
|
||
|
||
= hidden_field_tag :accept, params[:accept] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
- content_for :page_title do | ||
= t('auth.setup.title') | ||
|
||
- if missing_email? | ||
= simple_form_for(@user, url: auth_setup_path) do |f| | ||
= render 'shared/error_messages', object: @user | ||
= simple_form_for(@user, url: auth_setup_path) do |f| | ||
= render 'auth/shared/progress', stage: 'confirm' | ||
|
||
.fields-group | ||
%p.hint= t('auth.setup.email_below_hint_html') | ||
%h1.title= t('auth.setup.title') | ||
%p.lead= t('auth.setup.email_settings_hint_html', email: content_tag(:strong, @user.email)) | ||
|
||
.fields-group | ||
= f.input :email, required: true, hint: false, input_html: { 'aria-label': t('simple_form.labels.defaults.email'), autocomplete: 'off' } | ||
= render 'shared/error_messages', object: @user | ||
|
||
.actions | ||
= f.submit t('admin.accounts.change_email.label'), class: 'button' | ||
- else | ||
.simple_form | ||
%p.hint= t('auth.setup.email_settings_hint_html', email: content_tag(:strong, @user.email)) | ||
%p.lead | ||
%strong= t('auth.setup.link_not_received') | ||
%p.lead= t('auth.setup.email_below_hint_html') | ||
|
||
.fields-group | ||
= f.input :email, required: true, hint: false, input_html: { 'aria-label': t('simple_form.labels.defaults.email'), autocomplete: 'off' } | ||
|
||
.actions | ||
= f.submit t('auth.resend_confirmation'), class: 'button' | ||
|
||
.form-footer= render 'auth/shared/links' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- progress_index = { rules: 0, details: 1, confirm: 2 }[stage.to_sym] | ||
|
||
%ol.progress-tracker | ||
%li{ class: progress_index.positive? ? 'completed' : 'active' } | ||
.circle | ||
- if progress_index.positive? | ||
= check_icon | ||
.label= t('auth.progress.rules') | ||
%li.separator{ class: progress_index.positive? ? 'completed' : nil } | ||
%li{ class: [progress_index > 1 && 'completed', progress_index == 1 && 'active'] } | ||
.circle | ||
- if progress_index > 1 | ||
= check_icon | ||
.label= t('auth.progress.details') | ||
%li.separator{ class: progress_index > 1 ? 'completed' : nil } | ||
%li{ class: [progress_index > 2 && 'completed', progress_index == 2 && 'active'] } | ||
.circle | ||
- if progress_index > 2 | ||
= check_icon | ||
.label= t('auth.progress.confirm') | ||
- if approved_registrations? | ||
%li.separator{ class: progress_index > 2 ? 'completed' : nil } | ||
%li | ||
.circle | ||
.label= t('auth.progress.review') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.