From 980728279f0990bce0c6470cf5d8446a117207a6 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 7 Sep 2015 17:23:59 +0200 Subject: [PATCH] Adds registration "success" intermediate page --- app/controllers/users/registrations_controller.rb | 5 ++++- app/views/users/registrations/success.html.erb | 8 ++++++++ config/locales/devise_views.en.yml | 8 +++++++- config/locales/devise_views.es.yml | 6 ++++++ config/routes.rb | 3 ++- 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 app/views/users/registrations/success.html.erb diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 9ef3def2a..8e04c0d61 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -10,6 +10,9 @@ class Users::RegistrationsController < Devise::RegistrationsController end end + def success + end + def finish_signup end @@ -30,7 +33,7 @@ class Users::RegistrationsController < Devise::RegistrationsController end def after_inactive_sign_up_path_for(resource_or_scope) - beta_site? ? new_user_session_path : super + users_sign_up_success_path end end diff --git a/app/views/users/registrations/success.html.erb b/app/views/users/registrations/success.html.erb new file mode 100644 index 000000000..fa6102769 --- /dev/null +++ b/app/views/users/registrations/success.html.erb @@ -0,0 +1,8 @@ +

<%= t("devise_views.users.registrations.success.title") %>

+

<%= t("devise_views.users.registrations.success.thank_you_html") %>

+

<%= t("devise_views.users.registrations.success.instructions_1_html") %>

+

<%= t("devise_views.users.registrations.success.instructions_2_html") %>

+

+ <%= link_to t("devise_views.users.registrations.success.back_to_index"), + root_path, class: "button radius small margin-top" %> +

diff --git a/config/locales/devise_views.en.yml b/config/locales/devise_views.en.yml index 0cd894ba9..9562f63f8 100644 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -63,6 +63,12 @@ en: organization_signup_link: "Sign up here" terms: "To sign up in this site your accept the %{terms}" terms_link: "terms of use" + success: + title: "Review your email inbox" + thank_you_html: "Thank you for registering. Now you must confirm your email account." + instructions_1_html: "Please review your email inbox - we have sent you a link to confirm your account." + instructions_2_html: "Once you click that link, you will be able to start participating" + back_to_index: "Understood, take me back to the home page" organizations: registrations: new: @@ -79,7 +85,7 @@ en: instructions_1_html: "We will contact you soon in order to verify that you represent your collective." instructions_2_html: "Meanwhile, review your email. We have sent you a confirmation link to activate your account." instructions_3_html: "When you confirm your account will then be able to participate as a non-verified organization." - back_to_index: "Ok, go back to index" + back_to_index: "Understood, take me back to the home page" sessions: new: title: "Log in" diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index 0d240adf4..9fa3a5adc 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -63,6 +63,12 @@ es: organization_signup_link: "Regístrate aquí" terms: "Al registrarte aceptas las %{terms}" terms_link: "condiciones de uso" + success: + title: "Revisa tu correo" + thank_you_html: "Gracias por registrarte en la web. Ahora debes confirmar tu correo." + instructions_1_html: "Por favor revisa tu correo electrónico - te hemos enviado un enlace para confirmar tu cuenta." + instructions_2_html: "Una vez confirmado, podrás empezar a participar." + back_to_index: "Entendido, volver a la página principal" organizations: registrations: new: diff --git a/config/routes.rb b/config/routes.rb index 98c88894d..d363b62b4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,10 +11,11 @@ Rails.application.routes.draw do skip: [:omniauth_callbacks] devise_scope :organization do - get "organizations/sign_up/success", to: "organizations/registrations#success" + get 'organizations/sign_up/success', to: 'organizations/registrations#success' end devise_scope :user do + get 'users/sign_up/success', to: 'users/registrations#success' get :finish_signup, to: 'users/registrations#finish_signup' patch :do_finish_signup, to: 'users/registrations#do_finish_signup' end