flex around devise, also reconfirmable
This commit is contained in:
parent
13682fb58b
commit
0ccfab790b
1
Gemfile
1
Gemfile
@ -14,6 +14,7 @@ gem "sassc-rails"
|
|||||||
gem 'haml-rails'
|
gem 'haml-rails'
|
||||||
gem 'html2haml'
|
gem 'html2haml'
|
||||||
gem 'devise'
|
gem 'devise'
|
||||||
|
|
||||||
gem "ruby2js" , path: "../ruby2js"
|
gem "ruby2js" , path: "../ruby2js"
|
||||||
|
|
||||||
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
|
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
|
||||||
|
@ -117,6 +117,9 @@ GEM
|
|||||||
railties (>= 4.1.0)
|
railties (>= 4.1.0)
|
||||||
responders
|
responders
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
|
devise-tailwindcssed (0.1.5)
|
||||||
|
rails (>= 5.2.3.4, < 7.1)
|
||||||
|
railties (> 4.0, < 7.1)
|
||||||
diff-lcs (1.5.0)
|
diff-lcs (1.5.0)
|
||||||
erubi (1.11.0)
|
erubi (1.11.0)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
@ -330,6 +333,7 @@ DEPENDENCIES
|
|||||||
capybara
|
capybara
|
||||||
debug
|
debug
|
||||||
devise
|
devise
|
||||||
|
devise-tailwindcssed
|
||||||
guard-rspec
|
guard-rspec
|
||||||
haml-rails
|
haml-rails
|
||||||
html2haml
|
html2haml
|
||||||
|
55
app/helpers/devise_helper.rb
Normal file
55
app/helpers/devise_helper.rb
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
||||||
|
# devise helper
|
||||||
|
module DeviseHelper
|
||||||
|
def devise_error_messages!
|
||||||
|
return if resource.errors.empty?
|
||||||
|
|
||||||
|
messages = resource.errors.full_messages.map { |msg| content_tag(:p, "- #{msg}.") }
|
||||||
|
.join
|
||||||
|
sentence = I18n.t(
|
||||||
|
"errors.messages.not_saved",
|
||||||
|
count: resource.errors.count,
|
||||||
|
resource: resource.class.model_name.human.downcase
|
||||||
|
)
|
||||||
|
|
||||||
|
html = <<-HTML
|
||||||
|
<div class="bg-red-100 border-l-4 border-red-500 mb-4 p-4 text-red-700" role="alert">
|
||||||
|
<p class="font-bold">Oops!</p>
|
||||||
|
<p>#{sentence}</p>#{messages}
|
||||||
|
</div>
|
||||||
|
HTML
|
||||||
|
|
||||||
|
html.html_safe
|
||||||
|
end
|
||||||
|
|
||||||
|
def devise_simple_error_messages!
|
||||||
|
return if resource.errors.empty?
|
||||||
|
|
||||||
|
sentence = "Ooops!"
|
||||||
|
if resource.errors.count == 1
|
||||||
|
message = resource.errors.full_messages[0]
|
||||||
|
html = <<-HTML
|
||||||
|
<div class="bg-red-lightest border-l-4 border-red text-orange-dark p-4" role="alert">
|
||||||
|
<p class="font-bold">#{sentence}</p>
|
||||||
|
<p> #{message}.</p>
|
||||||
|
</div>
|
||||||
|
HTML
|
||||||
|
else
|
||||||
|
messages = resource.errors.full_messages.map { |msg| content_tag(:li, "#{msg}.") }
|
||||||
|
.join
|
||||||
|
html = <<-HTML
|
||||||
|
<div class="bg-red-100 border-l-4 border-red-500 mb-4 p-4 text-red-700" role="alert">
|
||||||
|
<p class="font-bold">#{sentence}</p>
|
||||||
|
<ul class="list-disc">
|
||||||
|
#{messages}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
HTML
|
||||||
|
end
|
||||||
|
|
||||||
|
html.html_safe
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
@ -1,10 +1,23 @@
|
|||||||
%h2 Resend confirmation instructions
|
.flex.justify-center
|
||||||
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
|
.w-full.max-w-xs
|
||||||
= render "devise/shared/error_messages", resource: resource
|
%h1.font-hairline.mb-6.text-center Resend Confirmation Instructions
|
||||||
.field
|
= form_for(resource, |
|
||||||
= f.label :email
|
as: resource_name, |
|
||||||
%br/
|
url: confirmation_path(resource_name), |
|
||||||
= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email)
|
html: { |
|
||||||
.actions
|
method: :post, |
|
||||||
= f.submit "Resend confirmation instructions"
|
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
|
||||||
= render "devise/shared/links"
|
}) do |f| |
|
||||||
|
= devise_error_messages!
|
||||||
|
.mb-4
|
||||||
|
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
|
= f.email_field :email, |
|
||||||
|
autofocus: true, |
|
||||||
|
autocomplete: "email", |
|
||||||
|
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), |
|
||||||
|
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline" |
|
||||||
|
.mb-4
|
||||||
|
= f.submit "Resend Confirmation Info", |
|
||||||
|
class: "button bg-blue-500 hover:bg-blue-700 font-bold text-white focus:outline-none py-2 px-4 rounded focus:shadow-outline w-full" |
|
||||||
|
= render "devise/shared/links"
|
||||||
|
= render "devise/shared/form_footer"
|
||||||
|
@ -1,19 +1,36 @@
|
|||||||
%h2 Change your password
|
.flex.justify-center
|
||||||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
|
.w-full.max-w-xs
|
||||||
= render "devise/shared/error_messages", resource: resource
|
%h2.font-hairline.mb-6.text-center Change Your Password
|
||||||
= f.hidden_field :reset_password_token
|
= form_for(resource, |
|
||||||
.field
|
as: resource_name, |
|
||||||
= f.label :password, "New password"
|
url: member_password_path(resource_name), |
|
||||||
%br/
|
html: { |
|
||||||
- if @minimum_password_length
|
method: :put, |
|
||||||
%em
|
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
|
||||||
(#{@minimum_password_length} characters minimum)
|
} |
|
||||||
%br/
|
) do |f| |
|
||||||
= f.password_field :password, autofocus: true, autocomplete: "new-password"
|
= devise_error_messages!
|
||||||
.field
|
= f.hidden_field :reset_password_token
|
||||||
= f.label :password_confirmation, "Confirm new password"
|
.mb-4
|
||||||
%br/
|
= f.label :password, "New Password", |
|
||||||
= f.password_field :password_confirmation, autocomplete: "new-password"
|
class: "block font-bold mb-2 text-gray-700 text-sm" |
|
||||||
.actions
|
- if @minimum_password_length
|
||||||
= f.submit "Change my password"
|
%small
|
||||||
= render "devise/shared/links"
|
%em.text-gray-600
|
||||||
|
(#{@minimum_password_length} characters minimum)
|
||||||
|
= f.password_field :password, |
|
||||||
|
autofocus: true, |
|
||||||
|
autocomplete: "new-password", |
|
||||||
|
class: "appearance-none border leading-tight focus:outline-none px-3 py-2 rounded shadow focus:shadow-outline text-gray-700 w-full" |
|
||||||
|
.mb-4
|
||||||
|
= f.label :password_confirmation, |
|
||||||
|
"Confirm New Password", |
|
||||||
|
class: "block font-bold mb-2 text-gray-700 text-sm" |
|
||||||
|
= f.password_field :password_confirmation, |
|
||||||
|
autocomplete: "off", |
|
||||||
|
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" |
|
||||||
|
.mb-4
|
||||||
|
= f.submit "Change My Password", |
|
||||||
|
class: "button bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline w-full" |
|
||||||
|
= render "devise/shared/links"
|
||||||
|
= render "devise/shared/form_footer"
|
||||||
|
@ -1,10 +1,20 @@
|
|||||||
%h2 Forgot your password?
|
.flex.justify-center
|
||||||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
.w-full.max-w-xs
|
||||||
= render "devise/shared/error_messages", resource: resource
|
%h1.font-hairline.mb-6.text-center Forgot your password?
|
||||||
.field
|
= form_for(resource, |
|
||||||
= f.label :email
|
as: resource_name, |
|
||||||
%br/
|
url: password_path(resource_name), |
|
||||||
= f.email_field :email, autofocus: true, autocomplete: "email"
|
html: { |
|
||||||
.actions
|
method: :post, |
|
||||||
= f.submit "Send me reset password instructions"
|
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
|
||||||
= render "devise/shared/links"
|
}) do |f| |
|
||||||
|
= devise_error_messages!
|
||||||
|
.mb-4
|
||||||
|
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
|
= f.email_field :email, autofocus: true, autocomplete: "email", |
|
||||||
|
class: "appearance-none border leading-tight focus:outline-none px-3 py-2 rounded shadow focus:shadow-outline text-gray-700 w-full" |
|
||||||
|
.mb-4
|
||||||
|
= f.submit "Send Password Reset Info", |
|
||||||
|
class: "button bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline w-full" |
|
||||||
|
= render "devise/shared/links"
|
||||||
|
= render "devise/shared/form_footer"
|
||||||
|
@ -1,36 +1,44 @@
|
|||||||
%h2
|
.flex.justify-center
|
||||||
Edit #{resource_name.to_s.humanize}
|
.w-full.max-w-xs
|
||||||
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
|
%h1.font-hairline.mb-6.text-center
|
||||||
= render "devise/shared/error_messages", resource: resource
|
Edit #{resource_name.to_s.humanize}
|
||||||
.field
|
= form_for(resource, |
|
||||||
= f.label :email
|
as: resource_name, |
|
||||||
%br/
|
url: registration_path(resource_name), |
|
||||||
= f.email_field :email, autofocus: true, autocomplete: "email"
|
html: { |
|
||||||
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
|
method: :put, |
|
||||||
%div
|
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
|
||||||
Currently waiting confirmation for: #{resource.unconfirmed_email}
|
} |
|
||||||
.field
|
) do |f| |
|
||||||
= f.label :password
|
= devise_error_messages!
|
||||||
%i (leave blank if you don't want to change it)
|
.mb-4
|
||||||
%br/
|
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
= f.password_field :password, autocomplete: "new-password"
|
%br/
|
||||||
- if @minimum_password_length
|
= f.email_field :email, |
|
||||||
%br/
|
autofocus: true, |
|
||||||
%em
|
autocomplete: "email", |
|
||||||
= @minimum_password_length
|
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline" |
|
||||||
characters minimum
|
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
|
||||||
.field
|
%div
|
||||||
= f.label :password_confirmation
|
Currently waiting confirmation for: #{resource.unconfirmed_email}
|
||||||
%br/
|
.mb-4
|
||||||
= f.password_field :password_confirmation, autocomplete: "new-password"
|
= f.label :password, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
.field
|
%i (leave blank if you don't want to change it)
|
||||||
= f.label :current_password
|
%br/
|
||||||
%i (we need your current password to confirm your changes)
|
= f.password_field :password, autocomplete: "new-password", class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline"
|
||||||
%br/
|
.mb-4
|
||||||
= f.password_field :current_password, autocomplete: "current-password"
|
= f.label :password_confirmation, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
.actions
|
= f.password_field :password_confirmation, |
|
||||||
= f.submit "Update"
|
autocomplete: "new-password", |
|
||||||
%h3 Cancel my account
|
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" |
|
||||||
%p
|
.mb-4
|
||||||
Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
|
= f.label :current_password, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
= link_to "Back", :back
|
= f.password_field :current_password, |
|
||||||
|
autocomplete: "current-password", |
|
||||||
|
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" |
|
||||||
|
.actions
|
||||||
|
= f.submit "Update", class: "button bg-blue-500 hover:bg-blue-700 font-bold text-white focus:outline-none py-2 px-4 rounded focus:shadow-outline w-full"
|
||||||
|
%p
|
||||||
|
Unhappy?
|
||||||
|
%span= button_to "Delete my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete
|
||||||
|
= link_to "Back", :back
|
||||||
|
@ -1,21 +1,36 @@
|
|||||||
%h2 Sign up
|
.flex.justify-center
|
||||||
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
|
.w-full.max-w-xs
|
||||||
= render "devise/shared/error_messages", resource: resource
|
%h1.font-hairline.mb-6.text-center Sign Up
|
||||||
.field
|
= form_for(resource, |
|
||||||
= f.label :email
|
as: resource_name, |
|
||||||
%br/
|
url: registration_path(resource_name), |
|
||||||
= f.email_field :email, autofocus: true, autocomplete: "email"
|
html: { |
|
||||||
.field
|
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
|
||||||
= f.label :password
|
} |
|
||||||
- if @minimum_password_length
|
) do |f| |
|
||||||
%em
|
= devise_error_messages!
|
||||||
(#{@minimum_password_length} characters minimum)
|
.mb-4
|
||||||
%br/
|
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
= f.password_field :password, autocomplete: "new-password"
|
= f.email_field :email, |
|
||||||
.field
|
autocomplete: "email", |
|
||||||
= f.label :password_confirmation
|
placeholder: "user@example.com", |
|
||||||
%br/
|
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline" |
|
||||||
= f.password_field :password_confirmation, autocomplete: "new-password"
|
.mb-4
|
||||||
.actions
|
= f.label :password, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
= f.submit "Sign up"
|
- if @minimum_password_length
|
||||||
= render "devise/shared/links"
|
%small
|
||||||
|
%em.text-gray-600
|
||||||
|
(#{@minimum_password_length} characters minimum)
|
||||||
|
= f.password_field :password, |
|
||||||
|
autocomplete: "new-password", |
|
||||||
|
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" |
|
||||||
|
.mb-4
|
||||||
|
= f.label :password_confirmation, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
|
= f.password_field :password_confirmation, |
|
||||||
|
autocomplete: "new-password", |
|
||||||
|
class: "appearance-none border leading-tight focus:outline-none px-3 py-2 rounded shadow focus:shadow-outline text-gray-700 w-full" |
|
||||||
|
.mb-4
|
||||||
|
= f.submit "Sign Up", |
|
||||||
|
class: "button bg-blue-500 hover:bg-blue-700 font-bold text-white focus:outline-none py-2 px-4 rounded focus:shadow-outline w-full" |
|
||||||
|
= render "devise/shared/links"
|
||||||
|
= render "devise/shared/form_footer"
|
||||||
|
@ -1,17 +1,37 @@
|
|||||||
%h2 Log in
|
.flex.justify-center
|
||||||
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
.w-full.max-w-xs
|
||||||
.field
|
%h1.font-hairline.mb-6.text-center Log In
|
||||||
= f.label :email
|
= form_for(resource, |
|
||||||
%br/
|
as: resource_name, |
|
||||||
= f.email_field :email, autofocus: true, autocomplete: "email"
|
url: session_path(resource_name), |
|
||||||
.field
|
html: { |
|
||||||
= f.label :password
|
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
|
||||||
%br/
|
} |
|
||||||
= f.password_field :password, autocomplete: "current-password"
|
) do |f| |
|
||||||
- if devise_mapping.rememberable?
|
= devise_simple_error_messages!
|
||||||
.field
|
- if flash.present?
|
||||||
= f.check_box :remember_me
|
.bg-red-100.border-l-4.border-red-500.text-red-700.p-4.mb-4{:role => "alert"}
|
||||||
= f.label :remember_me
|
%p.font-bold Oops!
|
||||||
.actions
|
- flash.each do |name, msg|
|
||||||
= f.submit "Log in"
|
= content_tag :p, |
|
||||||
= render "devise/shared/links"
|
msg.humanize, |
|
||||||
|
id: "flash_#{name}" if msg.is_a?(String) |
|
||||||
|
.mb-4
|
||||||
|
= f.label :email, class: "block text-gray-700 text-sm font-bold mb-2"
|
||||||
|
= f.email_field :email, autofocus: true, autocomplete: "email", |
|
||||||
|
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight foucs:outline-none focus:shadow-outline" |
|
||||||
|
.mb-4
|
||||||
|
= f.label :password, class: "block text-gray-700 text-sm font-bold mb-2"
|
||||||
|
= f.password_field :password, |
|
||||||
|
autocomplete: "current-password", |
|
||||||
|
class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" |
|
||||||
|
- if devise_mapping.rememberable?
|
||||||
|
.mb-4
|
||||||
|
= f.check_box :remember_me, class: "mr-2 leading-tight"
|
||||||
|
= f.label :remember_me, |
|
||||||
|
class: "align-baseline inline-block text-gray-700 text-sm" |
|
||||||
|
.mb-4
|
||||||
|
= f.submit "Log in", |
|
||||||
|
class: "button bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline w-full" |
|
||||||
|
= render "devise/shared/links"
|
||||||
|
= render "devise/shared/form_footer"
|
||||||
|
2
app/views/devise/shared/_form_footer.html.haml
Normal file
2
app/views/devise/shared/_form_footer.html.haml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
%p.text-center.text-gray-500.text-xs
|
||||||
|
Be a member of Hub Feenix
|
@ -1,19 +1,25 @@
|
|||||||
- if controller_name != 'sessions'
|
- if controller_name != 'sessions'
|
||||||
= link_to "Log in", new_session_path(resource_name)
|
= link_to "Log in", new_session_path(resource_name), |
|
||||||
%br/
|
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
|
||||||
- if devise_mapping.registerable? && controller_name != 'registrations'
|
|
||||||
= link_to "Sign up", new_registration_path(resource_name)
|
|
||||||
%br/
|
%br/
|
||||||
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
|
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
|
||||||
= link_to "Forgot your password?", new_password_path(resource_name)
|
= link_to "Forgot Password?", new_member_password_path(resource_name), |
|
||||||
|
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
|
||||||
|
%br/
|
||||||
|
- if devise_mapping.registerable? && controller_name != 'registrations'
|
||||||
|
= link_to "Sign up", new_registration_path(resource_name), |
|
||||||
|
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
|
||||||
%br/
|
%br/
|
||||||
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
||||||
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
|
= link_to "Didn't receive confirmation info?", new_member_confirmation_path(resource_name), |
|
||||||
|
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
|
||||||
%br/
|
%br/
|
||||||
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
|
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
|
||||||
= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
|
= link_to "Didn't receive unlock info?", new_member_unlock_path(resource_name), |
|
||||||
|
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
|
||||||
%br/
|
%br/
|
||||||
- if devise_mapping.omniauthable?
|
- if devise_mapping.omniauthable?
|
||||||
- resource_class.omniauth_providers.each do |provider|
|
- resource_class.omniauth_providers.each do |provider|
|
||||||
= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post
|
= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), |
|
||||||
|
class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" |
|
||||||
%br/
|
%br/
|
||||||
|
@ -1,10 +1,23 @@
|
|||||||
%h2 Resend unlock instructions
|
.flex.justify-center
|
||||||
= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
|
.w-full.max-w-xs
|
||||||
= render "devise/shared/error_messages", resource: resource
|
%h1.font-hairline.mb-6.text-center Resend Unlock Info
|
||||||
.field
|
= form_for(resource, |
|
||||||
= f.label :email
|
as: resource_name, |
|
||||||
%br/
|
url: unlock_path(resource_name), |
|
||||||
= f.email_field :email, autofocus: true, autocomplete: "email"
|
html: { |
|
||||||
.actions
|
method: :post, |
|
||||||
= f.submit "Resend unlock instructions"
|
class: "bg-white mb-4 px-8 pt-6 pb-8 rounded shadow-md" |
|
||||||
= render "devise/shared/links"
|
} |
|
||||||
|
) do |f| |
|
||||||
|
= devise_error_messages!
|
||||||
|
.mb-4
|
||||||
|
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"
|
||||||
|
= f.email_field :email, |
|
||||||
|
autofocus: true, |
|
||||||
|
autocomplete: "email", |
|
||||||
|
class: "appearance-none border leading-tight focus:outline-none px-3 py-2 rounded shadow focus:shadow-outline text-gray-700 w-full" |
|
||||||
|
.mb-4
|
||||||
|
= f.submit "Resend unlock instructions", |
|
||||||
|
class: "button bg-blue-500 hover:bg-blue-700 font-bold text-white focus:outline-none py-2 px-4 rounded focus:shadow-outline w-full" |
|
||||||
|
= render "devise/shared/links"
|
||||||
|
= render "devise/shared/form_footer"
|
||||||
|
@ -157,7 +157,7 @@ Devise.setup do |config|
|
|||||||
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
||||||
# db field (see migrations). Until confirmed, new email is stored in
|
# db field (see migrations). Until confirmed, new email is stored in
|
||||||
# unconfirmed_email column, and copied to email column on successful confirmation.
|
# unconfirmed_email column, and copied to email column on successful confirmation.
|
||||||
# config.reconfirmable = true
|
config.reconfirmable = true
|
||||||
|
|
||||||
# Defines which key will be used when confirming an account
|
# Defines which key will be used when confirming an account
|
||||||
# config.confirmation_keys = [:email]
|
# config.confirmation_keys = [:email]
|
||||||
|
@ -25,7 +25,7 @@ class AddDeviseToMembers < ActiveRecord::Migration[7.0]
|
|||||||
t.string :confirmation_token
|
t.string :confirmation_token
|
||||||
t.datetime :confirmed_at
|
t.datetime :confirmed_at
|
||||||
t.datetime :confirmation_sent_at
|
t.datetime :confirmation_sent_at
|
||||||
#t.string :unconfirmed_email # Only if using reconfirmable
|
t.string :unconfirmed_email # Only if using reconfirmable
|
||||||
|
|
||||||
## Lockable
|
## Lockable
|
||||||
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
||||||
|
1
db/schema.rb
generated
1
db/schema.rb
generated
@ -27,6 +27,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_20_150958) do
|
|||||||
t.string "confirmation_token"
|
t.string "confirmation_token"
|
||||||
t.datetime "confirmed_at"
|
t.datetime "confirmed_at"
|
||||||
t.datetime "confirmation_sent_at"
|
t.datetime "confirmation_sent_at"
|
||||||
|
t.string "unconfirmed_email"
|
||||||
t.index ["email"], name: "index_members_on_email", unique: true
|
t.index ["email"], name: "index_members_on_email", unique: true
|
||||||
t.index ["reset_password_token"], name: "index_members_on_reset_password_token", unique: true
|
t.index ["reset_password_token"], name: "index_members_on_reset_password_token", unique: true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user