forked from fixin.me/fixin.me
Merge recover password/resend confirmation forms into sign in/register
Closes #65, #66
This commit is contained in:
1
app/views/users/confirmations/create.turbo_stream.erb
Normal file
1
app/views/users/confirmations/create.turbo_stream.erb
Normal file
@@ -0,0 +1 @@
|
||||
<% flash.discard %>
|
||||
@@ -1,9 +0,0 @@
|
||||
<%= labeled_form_for resource, url: user_confirmation_path,
|
||||
html: {class: 'main-area'} do |f| %>
|
||||
|
||||
<%= f.email_field :email, required: true, size: 30, autofocus: true,
|
||||
autocomplete: 'email', value:
|
||||
resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email %>
|
||||
|
||||
<%= f.submit t(:resend_confirmation) %>
|
||||
<% end %>
|
||||
2
app/views/users/passwords/create.turbo_stream.erb
Normal file
2
app/views/users/passwords/create.turbo_stream.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<%# For some reason flash messages are duplicated in bot flash and flash.now %>
|
||||
<% flash.discard %>
|
||||
@@ -1,5 +1,5 @@
|
||||
<%= labeled_form_for resource, url: user_password_path,
|
||||
html: {method: :put, class: 'main-area'} do |f| %>
|
||||
html: {method: :put, class: 'main-area', data: {turbo: false}} do |f| %>
|
||||
|
||||
<%= f.hidden_field :reset_password_token %>
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<%= labeled_form_for resource, url: user_password_path,
|
||||
html: {class: 'main-area'} do |f| %>
|
||||
|
||||
<%= f.email_field :email, required: true, size: 30, autofocus: true,
|
||||
autocomplete: 'email' %>
|
||||
|
||||
<%= f.submit t(:recover_password) %>
|
||||
<% end %>
|
||||
17
app/views/users/profiles/new.html.erb
Normal file
17
app/views/users/profiles/new.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<%= labeled_form_for resource, url: user_registration_path,
|
||||
html: {class: 'main-area', onsubmit: 'formValidate(event)'} do |f| %>
|
||||
|
||||
<%= f.email_field :email, required: true, size: 30, autofocus: true,
|
||||
autocomplete: 'email' %>
|
||||
<%= f.password_field :password, required: true, size: 30,
|
||||
minlength: @minimum_password_length, autocomplete: 'new-password' %>
|
||||
<%= f.password_field :password_confirmation, required: true, size: 30,
|
||||
minlength: @minimum_password_length, autocomplete: 'off' %>
|
||||
|
||||
<%= f.submit t(:register), data: {turbo: false} %>
|
||||
|
||||
<%# TODO: fix button text color after change link -> button %>
|
||||
<%= image_button_tag t(:resend_confirmation), 'email-sync-outline',
|
||||
class: 'auxiliary', formaction: user_confirmation_path, formnovalidate: true,
|
||||
data: {validate: f.field_id(:email)} %>
|
||||
<% end %>
|
||||
@@ -1,16 +0,0 @@
|
||||
<div class="main-area">
|
||||
<%= labeled_form_for resource, url: user_registration_path do |f| %>
|
||||
<%= f.email_field :email, required: true, size: 30, autofocus: true,
|
||||
autocomplete: 'email' %>
|
||||
<%= f.password_field :password, required: true, size: 30,
|
||||
minlength: @minimum_password_length, autocomplete: 'new-password' %>
|
||||
<%= f.password_field :password_confirmation, required: true, size: 30,
|
||||
minlength: @minimum_password_length, autocomplete: 'off' %>
|
||||
|
||||
<%= f.submit t(:register) %>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :p, t(:or), style: 'text-align: center;' %>
|
||||
<%= image_link_to t(:resend_confirmation), 'email-sync-outline',
|
||||
new_user_confirmation_path, class: 'centered' %>
|
||||
</div>
|
||||
@@ -1,18 +1,19 @@
|
||||
<div class="main-area">
|
||||
<%= labeled_form_for resource, url: user_session_path do |f| %>
|
||||
<%= f.email_field :email, required: true, size: 30, autofocus: true,
|
||||
autocomplete: 'email' %>
|
||||
<%= f.password_field :password, required: true, size: 30,
|
||||
minlength: @minimum_password_length, autocomplete: 'current-password' %>
|
||||
<%= labeled_form_for resource, url: user_session_path,
|
||||
html: {class: 'main-area', onsubmit: 'formValidate(event)'} do |f| %>
|
||||
|
||||
<% if devise_mapping.rememberable? %>
|
||||
<%= f.check_box :remember_me %>
|
||||
<% end %>
|
||||
<%= f.email_field :email, required: true, size: 30, autofocus: true,
|
||||
autocomplete: 'email' %>
|
||||
<%= f.password_field :password, required: true, size: 30,
|
||||
autocomplete: 'current-password' %>
|
||||
|
||||
<%= f.submit t(:sign_in) %>
|
||||
<% if devise_mapping.rememberable? %>
|
||||
<%= f.check_box :remember_me %>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :p, t(:or), style: 'text-align: center;' %>
|
||||
<%= image_link_to t(:recover_password), 'lock-reset', new_user_password_path,
|
||||
class: 'centered' %>
|
||||
</div>
|
||||
<%# /sign_in as HTML; /password as TURBO_STREAM %>
|
||||
<%= f.submit t(:sign_in), data: {turbo: false} %>
|
||||
|
||||
<%= image_button_tag t(:recover_password), 'lock-reset', class: 'auxiliary',
|
||||
formaction: user_password_path, formnovalidate: true,
|
||||
data: {validate: f.field_id(:email)} %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user