|
29 | 29 | <% else %> |
30 | 30 | <div class="row justify-content-center"> |
31 | 31 | <div class="col-md-6"> |
32 | | - <h2 class="mb-4"><%= t('.sign_up') %></h2> |
| 32 | + <h2 id="registration-title" class="mb-4"><%= t('.sign_up') %></h2> |
33 | 33 |
|
34 | | - <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: 'card card-body needs-validation', novalidate: true }, data: { controller: 'better_together--form-validation', turbo: false }) do |f| %> |
| 34 | + <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { id: 'registration-form', class: 'card card-body needs-validation registration-form', novalidate: true }, data: { controller: 'better_together--form-validation', turbo: false }) do |f| %> |
35 | 35 | <%= render "devise/shared/error_messages", resource: resource %> |
36 | 36 |
|
37 | 37 | <% if @platform_invitation %> |
38 | | - <%= hidden_field_tag :invitation_code, @platform_invitation.token %> |
| 38 | + <%= hidden_field_tag :invitation_code, @platform_invitation.token, id: 'invitation-code-field' %> |
39 | 39 | <% end %> |
40 | 40 |
|
41 | 41 | <!-- Email Field --> |
42 | | - <div class="mb-3"> |
43 | | - <%= f.label :email, t('.email.label'), class: 'form-label' %> |
44 | | - <%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'form-control', required: true %> |
45 | | - <small class="form-text text-muted"><%= t('.email.help') %></small> |
| 42 | + <div id="email-field-group" class="mb-3 form-field-group"> |
| 43 | + <%= f.label :email, t('.email.label'), class: 'form-label', for: 'user_email' %> |
| 44 | + <%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'form-control', required: true, id: 'user_email' %> |
| 45 | + <small id="email-help-text" class="form-text text-muted"><%= t('.email.help') %></small> |
46 | 46 | </div> |
47 | 47 |
|
48 | 48 | <!-- Password Field --> |
49 | | - <div class="mb-3" data-controller="better_together--password-toggle"> |
50 | | - <%= f.label :password, t('.password.label'), class: 'form-label' %> |
| 49 | + <div id="password-field-group" class="mb-3 form-field-group" data-controller="better_together--password-toggle"> |
| 50 | + <%= f.label :password, t('.password.label'), class: 'form-label', for: 'user_password' %> |
51 | 51 | <% if @minimum_password_length %> |
52 | | - <em><%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %></em> |
| 52 | + <em id="password-length-requirement"><%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %></em> |
53 | 53 | <% end %> |
54 | 54 | <div class="input-group"> |
55 | | - <%= f.password_field :password, autocomplete: "current-password", class: 'form-control', "data-target": "better_together--password-toggle.field", required: true, minlength: @minimum_password_length || 12 %> |
56 | | - <button type="button" data-action="click->better_together--password-toggle#password" class="btn btn-outline-secondary" data-bs-toggle="tooltip" title="<%= t('devise.sessions.new.password.toggle') %>"> |
| 55 | + <%= f.password_field :password, autocomplete: "current-password", class: 'form-control', "data-target": "better_together--password-toggle.field", required: true, minlength: @minimum_password_length || 12, id: 'user_password' %> |
| 56 | + <button id="password-toggle-btn" type="button" data-action="click->better_together--password-toggle#password" class="btn btn-outline-secondary" data-bs-toggle="tooltip" title="<%= t('devise.sessions.new.password.toggle') %>"> |
57 | 57 | <i class="password-field-icon-1 far fa-eye-slash" data-target="better_together--password-toggle.icon"></i> |
58 | 58 | </button> |
59 | 59 | </div> |
60 | | - <small class="form-text text-muted"><%= t('.password.help') %></small> |
| 60 | + <small id="password-help-text" class="form-text text-muted"><%= t('.password.help') %></small> |
61 | 61 | </div> |
62 | 62 |
|
63 | 63 | <!-- Password Confirmation Field --> |
64 | | - <div class="mb-3" data-controller="better_together--password-toggle"> |
65 | | - <%= f.label :password_confirmation, t('.password_confirmation.label'), class: 'form-label' %> |
| 64 | + <div id="password-confirmation-field-group" class="mb-3 form-field-group" data-controller="better_together--password-toggle"> |
| 65 | + <%= f.label :password_confirmation, t('.password_confirmation.label'), class: 'form-label', for: 'user_password_confirmation' %> |
66 | 66 |
|
67 | 67 | <div class="input-group"> |
68 | | - <%= f.password_field :password_confirmation, autocomplete: "current-password", class: 'form-control', "data-target": "better_together--password-toggle.field", required: true, minlength: @minimum_password_length || 12 %> |
69 | | - <button type="button" data-action="click->better_together--password-toggle#password" class="btn btn-outline-secondary" data-bs-toggle="tooltip" title="<%= t('devise.sessions.new.password.toggle') %>"> |
| 68 | + <%= f.password_field :password_confirmation, autocomplete: "current-password", class: 'form-control', "data-target": "better_together--password-toggle.field", required: true, minlength: @minimum_password_length || 12, id: 'user_password_confirmation' %> |
| 69 | + <button id="password-confirmation-toggle-btn" type="button" data-action="click->better_together--password-toggle#password" class="btn btn-outline-secondary" data-bs-toggle="tooltip" title="<%= t('devise.sessions.new.password.toggle') %>"> |
70 | 70 | <i class="password-field-icon-1 far fa-eye-slash" data-target="better_together--password-toggle.icon"></i> |
71 | 71 | </button> |
72 | 72 | </div> |
73 | | - <small class="form-text text-muted"><%= t('.password_confirmation.help') %></small> |
| 73 | + <small id="password-confirmation-help-text" class="form-text text-muted"><%= t('.password_confirmation.help') %></small> |
74 | 74 | </div> |
75 | 75 |
|
76 | | - <div id="profile-details" class="mb-4"> |
77 | | - <h4><%= t('.profile_details') %></h4> |
| 76 | + <div id="profile-details" class="mb-4 profile-details-section"> |
| 77 | + <h4 id="profile-details-title"><%= t('.profile_details') %></h4> |
78 | 78 | <!-- Person Identification Fields --> |
79 | 79 | <%= f.fields_for :person do |person_form| %> |
80 | 80 | <!-- Name Field --> |
81 | | - <div class="mb-3"> |
82 | | - <%= person_form.label :name, t('.person.name'), class: 'form-label' %> |
83 | | - <%= person_form.text_field :name, class: "form-control", required: true %> |
84 | | - <small class="form-text text-muted"><%= t('.person.name_hint') %></small> |
| 81 | + <div id="name-field-group" class="mb-3 form-field-group"> |
| 82 | + <%= person_form.label :name, t('.person.name'), class: 'form-label', for: 'user_person_attributes_name' %> |
| 83 | + <%= person_form.text_field :name, class: "form-control", required: true, id: 'user_person_attributes_name' %> |
| 84 | + <small id="name-help-text" class="form-text text-muted"><%= t('.person.name_hint') %></small> |
85 | 85 | </div> |
86 | 86 |
|
87 | 87 | <!-- Username Field --> |
88 | | - <div class="mb-3"> |
89 | | - <%= person_form.label :identifier, t('.person.identifier'), class: 'form-label' %> |
90 | | - <%= person_form.text_field :identifier, class: "form-control", required: true, minlength: 3 %> |
| 88 | + <div id="identifier-field-group" class="mb-3 form-field-group"> |
| 89 | + <%= person_form.label :identifier, t('.person.identifier'), class: 'form-label', for: 'user_person_attributes_identifier' %> |
| 90 | + <%= person_form.text_field :identifier, class: "form-control", required: true, minlength: 3, id: 'user_person_attributes_identifier' %> |
91 | 91 | <!-- Hint text for the Handle --> |
92 | | - <small class="form-text text-muted"><%= t('.person.identifier_hint_html', platform: host_platform) %></small> |
| 92 | + <small id="identifier-help-text" class="form-text text-muted"><%= t('.person.identifier_hint_html', platform: host_platform) %></small> |
93 | 93 | </div> |
94 | 94 |
|
95 | 95 | <!-- Description Field --> |
96 | | - <div class="mb-3"> |
97 | | - <%= person_form.label :description, t('.person.description'), class: 'form-label' %> |
98 | | - <%= person_form.text_area :description, class: "form-control" %> |
99 | | - <small class="form-text text-muted"><%= t('.person.description_hint') %></small> |
| 96 | + <div id="description-field-group" class="mb-3 form-field-group"> |
| 97 | + <%= person_form.label :description, t('.person.description'), class: 'form-label', for: 'user_person_attributes_description' %> |
| 98 | + <%= person_form.text_area :description, class: "form-control", id: 'user_person_attributes_description' %> |
| 99 | + <small id="description-help-text" class="form-text text-muted"><%= t('.person.description_hint') %></small> |
100 | 100 | </div> |
101 | 101 | <% end %> |
102 | 102 | </div> |
103 | 103 |
|
104 | 104 | <% if @terms_of_service_agreement || @privacy_policy_agreement || @code_of_conduct_agreement %> |
| 105 | + <div id="agreements-section" class="agreements-section"> |
105 | 106 | <% if @terms_of_service_agreement %> |
106 | | - <div class="mb-3 form-check"> |
107 | | - <%= check_box_tag :terms_of_service_agreement, '1', false, class: 'form-check-input agreement-checkbox', data: { agreement_identifier: 'terms_of_service' }, required: true, aria: { describedby: 'terms-of-service-summary', disabled: 'true' } %> |
108 | | - <%= label_tag :terms_of_service_agreement, t('.terms_of_service.label'), class: 'form-check-label' %> |
| 107 | + <div id="terms-of-service-agreement-group" class="mb-3 form-check agreement-group"> |
| 108 | + <%= check_box_tag :terms_of_service_agreement, '1', false, class: 'form-check-input agreement-checkbox', data: { agreement_identifier: 'terms_of_service' }, required: true, aria: { describedby: 'terms-of-service-summary', disabled: 'true' }, id: 'terms_of_service_agreement_checkbox' %> |
| 109 | + <%= label_tag :terms_of_service_agreement, t('.terms_of_service.label'), class: 'form-check-label', for: 'terms_of_service_agreement_checkbox' %> |
109 | 110 | <%= link_to t('.view', default: 'View'), agreement_path(@terms_of_service_agreement, locale: I18n.locale), class: 'ms-2 agreement-modal-link', role: 'button', data: { agreement_identifier: 'terms_of_service' } %> |
110 | | - <p id="terms-of-service-summary" class="form-text text-muted"><%= @terms_of_service_agreement.description %></p> |
| 111 | + <small id="terms-of-service-summary" class="form-text text-muted"><%= @terms_of_service_agreement.description %></small> |
111 | 112 | </div> |
112 | 113 | <% end %> |
113 | 114 |
|
114 | 115 | <% if @privacy_policy_agreement %> |
115 | | - <div class="mb-3 form-check"> |
116 | | - <%= check_box_tag :privacy_policy_agreement, '1', false, class: 'form-check-input agreement-checkbox', data: { agreement_identifier: 'privacy_policy' }, required: true, aria: { describedby: 'privacy-policy-summary', disabled: 'true' } %> |
117 | | - <%= label_tag :privacy_policy_agreement, t('.privacy_policy.label'), class: 'form-check-label' %> |
| 116 | + <div id="privacy-policy-agreement-group" class="mb-3 form-check agreement-group"> |
| 117 | + <%= check_box_tag :privacy_policy_agreement, '1', false, class: 'form-check-input agreement-checkbox', data: { agreement_identifier: 'privacy_policy' }, required: true, aria: { describedby: 'privacy-policy-summary', disabled: 'true' }, id: 'privacy_policy_agreement_checkbox' %> |
| 118 | + <%= label_tag :privacy_policy_agreement, t('.privacy_policy.label'), class: 'form-check-label', for: 'privacy_policy_agreement_checkbox' %> |
118 | 119 | <%= link_to t('.view', default: 'View'), agreement_path(@privacy_policy_agreement, locale: I18n.locale), class: 'ms-2 agreement-modal-link', role: 'button', data: { agreement_identifier: 'privacy_policy' } %> |
119 | | - <p id="privacy-policy-summary" class="form-text text-muted"><%= @privacy_policy_agreement.description %></p> |
| 120 | + <small id="privacy-policy-summary" class="form-text text-muted"><%= @privacy_policy_agreement.description %></small> |
120 | 121 | </div> |
121 | 122 | <% end %> |
122 | 123 |
|
123 | 124 | <% if @code_of_conduct_agreement %> |
124 | | - <div class="mb-3 form-check"> |
125 | | - <%= check_box_tag :code_of_conduct_agreement, '1', false, class: 'form-check-input agreement-checkbox', data: { agreement_identifier: 'code_of_conduct' }, required: true, aria: { describedby: 'code-of-conduct-summary', disabled: 'true' } %> |
126 | | - <%= label_tag :code_of_conduct_agreement, t('.code_of_conduct.label'), class: 'form-check-label' %> |
| 125 | + <div id="code-of-conduct-agreement-group" class="mb-3 form-check agreement-group"> |
| 126 | + <%= check_box_tag :code_of_conduct_agreement, '1', false, class: 'form-check-input agreement-checkbox', data: { agreement_identifier: 'code_of_conduct' }, required: true, aria: { describedby: 'code-of-conduct-summary', disabled: 'true' }, id: 'code_of_conduct_agreement_checkbox' %> |
| 127 | + <%= label_tag :code_of_conduct_agreement, t('.code_of_conduct.label'), class: 'form-check-label', for: 'code_of_conduct_agreement_checkbox' %> |
127 | 128 | <%= link_to t('.view', default: 'View'), agreement_path(@code_of_conduct_agreement, locale: I18n.locale), class: 'ms-2 agreement-modal-link', role: 'button', data: { agreement_identifier: 'code_of_conduct' } %> |
128 | | - <p id="code-of-conduct-summary" class="form-text text-muted"><%= @code_of_conduct_agreement.description %></p> |
| 129 | + <small id="code-of-conduct-summary" class="form-text text-muted"><%= @code_of_conduct_agreement.description %></small> |
129 | 130 | </div> |
130 | 131 | <% end %> |
| 132 | + </div> |
131 | 133 | <% end %> |
132 | 134 |
|
| 135 | + <!-- Host App Extensible Content (e.g., CAPTCHA, additional fields) --> |
| 136 | + <%= render partial: 'devise/registrations/extra_registration_fields', locals: { form: f, resource: resource } %> |
| 137 | + |
133 | 138 | <!-- Submit Button --> |
134 | | - <div class="text-center"> |
135 | | - <%= f.submit t('.sign_up'), class: 'btn btn-primary' %> |
| 139 | + <div id="submit-section" class="text-center submit-section"> |
| 140 | + <%= f.submit t('.sign_up'), class: 'btn btn-primary', id: 'registration-submit-btn' %> |
136 | 141 | <!-- Additional Links --> |
137 | | - <%= render "devise/shared/links" %> |
| 142 | + <div id="additional-links" class="additional-links"> |
| 143 | + <%= render "devise/shared/links" %> |
| 144 | + </div> |
138 | 145 | </div> |
139 | 146 | <% end %> |
140 | 147 | </div> |
|
0 commit comments