Commit a58bf498 by Mai Hoang Thai Ha

add page register/2

parent 0f84c9fd
...@@ -3,16 +3,25 @@ ...@@ -3,16 +3,25 @@
class Users::RegistrationsController < Devise::RegistrationsController class Users::RegistrationsController < Devise::RegistrationsController
# before_action :configure_sign_up_params, only: [:create] # before_action :configure_sign_up_params, only: [:create]
# before_action :configure_account_update_params, only: [:update] # before_action :configure_account_update_params, only: [:update]
def information def information
self.resource = resource_class.new self.resource = resource_class.new
signed_in_resource signed_in_resource
render :infomation render :infomation
end end
def send_mail; end
protected protected
def update_resource(resource, params) def update_resource(resource, params)
resource.update_without_password(params) resource.update_without_password(params)
end end
def after_inactive_sign_up_path_for(resource)
scope = Devise::Mapping.find_scope!(resource)
router_name = Devise.mappings[scope].router_name
context = router_name ? send(router_name) : self
context.respond_to?(:send_signup_mail_path) ? context.send_signup_mail_path : "/"
end
end end
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
= render 'users/shared/error_messages', resource: resource = render 'users/shared/error_messages', resource: resource
.field.row.mb-2.form-group .field.row.mb-2.form-group
.col-3
= f.label :email, class: 'form-label'
.col-9
= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control mb-2'
span.form-msg
.field.row.mb-2.form-group
- if devise_mapping.confirmable? && resource.pending_reconfirmation? - if devise_mapping.confirmable? && resource.pending_reconfirmation?
div div
| Currently waiting confirmation for: | Currently waiting confirmation for:
......
.container.text-center
h2.my-5
| Register
p
| Thank you for register our service, an confirmation email with registration link has been sent to your email. Please check your email within 24 hours.
p
| Please note that the registration link is only valid for 24 hours.
p
| Over that period, you will have to register your email again.
\ No newline at end of file
...@@ -41,7 +41,8 @@ en: ...@@ -41,7 +41,8 @@ en:
signed_up: "Welcome! You have signed up successfully." signed_up: "Welcome! You have signed up successfully."
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." # signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
signed_up_but_unconfirmed: ""
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address." update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
updated: "Your account has been updated successfully." updated: "Your account has been updated successfully."
updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again." updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
......
...@@ -10,6 +10,7 @@ Rails.application.routes.draw do ...@@ -10,6 +10,7 @@ Rails.application.routes.draw do
get '/forgot_password', to: 'devise/passwords#new', as: :forgot_password get '/forgot_password', to: 'devise/passwords#new', as: :forgot_password
get '/reset_password', to: 'devise/passwords#edit', as: :reset_password get '/reset_password', to: 'devise/passwords#edit', as: :reset_password
get '/register/1', to: 'devise/registrations#new', as: :signup get '/register/1', to: 'devise/registrations#new', as: :signup
get '/register/2', to: 'users/registrations#send_mail', as: :send_signup_mail
get '/register/3', to: 'users/registrations#information', as: :signup_infomation get '/register/3', to: 'users/registrations#information', as: :signup_infomation
end end
root 'top#index' root 'top#index'
......
.container.text-center
h2.my-5
| Register
p
| Thank you for register our service, an confirmation email with registration link has been sent to your email. Please check your email within 24 hours.
p
| Please note that the registration link is only valid for 24 hours.
p
| Over that period, you will have to register your email again.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment