From 5e31a9f3384e796878a6cffa8fee2c43953b64a7 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 24 Aug 2015 14:34:58 +0200 Subject: [PATCH 1/3] adds a new "organization sigup success" view. Related with #226 --- .../organizations/registrations_controller.rb | 8 ++++++++ app/views/organizations/registrations/success.html.erb | 8 ++++++++ config/locales/devise_views.en.yml | 9 +++++++++ config/locales/devise_views.es.yml | 8 ++++++++ config/routes.rb | 9 +++++++-- 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 app/views/organizations/registrations/success.html.erb diff --git a/app/controllers/organizations/registrations_controller.rb b/app/controllers/organizations/registrations_controller.rb index 8602ba4ba..630cc64e4 100644 --- a/app/controllers/organizations/registrations_controller.rb +++ b/app/controllers/organizations/registrations_controller.rb @@ -5,6 +5,9 @@ class Organizations::RegistrationsController < Devise::RegistrationsController end end + def success + end + def create build_resource(sign_up_params) if resource.valid_with_captcha? @@ -17,6 +20,11 @@ class Organizations::RegistrationsController < Devise::RegistrationsController end end + protected + def after_inactive_sign_up_path_for(resource) + organizations_sign_up_success_path + end + private def sign_up_params diff --git a/app/views/organizations/registrations/success.html.erb b/app/views/organizations/registrations/success.html.erb new file mode 100644 index 000000000..91c377102 --- /dev/null +++ b/app/views/organizations/registrations/success.html.erb @@ -0,0 +1,8 @@ +

<%= t('devise_views.organizations.registrations.success.title') %>

+ +

<%= t('devise_views.organizations.registrations.success.thank_you') %>

+ +

<%= t('devise_views.organizations.registrations.success.instructions') %>

+ +

<%= link_to t('devise_views.organizations.registrations.success.back_to_index'), root_path %>

+ diff --git a/config/locales/devise_views.en.yml b/config/locales/devise_views.en.yml index e1b2a571d..394c3611c 100644 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -66,6 +66,15 @@ en: phone_number_label: "Phone number" password_confirmation_label: "Confirm password" submit: "Sign up" + success: + title: "Registration of organization / collective pending verification" + thank_you: "Thank you for registering your organization or collective in the website." + instructions: + We will contact you soon in order to verify that you represent your collective. + Meanwhile, please review your email. We have sent you a confirmation link which you + will have to click in order to activate your account. You will then be able to participate + as a non-verified organization. + back_to_index: "Ok, go back to index" sessions: new: title: "Log in" diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index 7ed5298de..e27065038 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -66,6 +66,14 @@ es: phone_number_label: "Teléfono" password_confirmation_label: "Confirmar contraseña" submit: "Registrarse" + success: + title: "Registro de organización / colectivo pendiente de verificación" + thank_you: "Gracias por registrar tu colectivo en la web." + instructions: + En breve nos pondremos en contacto contigo para verificar que realmente representas a un colectivo. + Entretanto, por favor revisa tu correo electrónico. Te hemos enviado un enlace que debes pulsar para confirmar + tu correo. Una vez confirmado, podrás empezar a participar como colectivo no verificado. + back_to_index: "Entendido, volver a la página principal" sessions: new: title: "Entrar" diff --git a/config/routes.rb b/config/routes.rb index f224609b9..d55068aab 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,15 @@ Rails.application.routes.draw do devise_for :users, controllers: { registrations: 'users/registrations' } - devise_for :organizations, class_name: 'User', + devise_for(:organizations, class_name: 'User', controllers: { registrations: 'organizations/registrations', sessions: 'devise/sessions' - } + }) + + devise_scope :organization do + get "organizations/sign_up/success", to: "organizations/registrations#success" + end + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". From 7d17209be63e8eaf4c7e18ed1bb10d5ff78e43ab Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 25 Aug 2015 16:47:53 +0200 Subject: [PATCH 2/3] Adds styles for organization success registration [#226] --- app/assets/stylesheets/participacion.scss | 22 ++++++++++++++++-- app/assets/stylesheets/variables.scss | 1 + .../registrations/success.html.erb | 23 ++++++++++++------- config/locales/devise_views.en.yml | 12 ++++------ config/locales/devise_views.es.yml | 11 ++++----- 5 files changed, 46 insertions(+), 23 deletions(-) diff --git a/app/assets/stylesheets/participacion.scss b/app/assets/stylesheets/participacion.scss index e6aea4db2..9d5487ac9 100644 --- a/app/assets/stylesheets/participacion.scss +++ b/app/assets/stylesheets/participacion.scss @@ -150,6 +150,19 @@ h1, h2, h3, h4, h5, h6 { } } +.margin { + margin-top: $line-height; + margin-bottom: $line-height; +} + +.margin-top { + margin-top: $line-height; +} + +.margin-bottom { + margin-bottom: $line-height; +} + // 04. Header // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -494,9 +507,14 @@ footer { h2 { clear: both; - font-size: rem-calc(30); + font-size: rem-calc(18); font-weight: bold; - line-height: $line-height*2; + line-height: $line-height; + + @media (min-width: $small-breakpoint) { + font-size: rem-calc(30); + line-height: $line-height*2; + } } .back, .icon-angle-left { diff --git a/app/assets/stylesheets/variables.scss b/app/assets/stylesheets/variables.scss index 93107e3d2..7d4baeff4 100644 --- a/app/assets/stylesheets/variables.scss +++ b/app/assets/stylesheets/variables.scss @@ -83,6 +83,7 @@ $comment-level-5: rgba(255,241,204,1); // 06. Responsive // - - - - - - - - - - - - - - - - - - - - - - - - - +$small: em-calc(480); $small-breakpoint: em-calc(640); $medium-breakpoint: em-calc(1024); $large-breakpoint: em-calc(1440); diff --git a/app/views/organizations/registrations/success.html.erb b/app/views/organizations/registrations/success.html.erb index 91c377102..d4c0953f6 100644 --- a/app/views/organizations/registrations/success.html.erb +++ b/app/views/organizations/registrations/success.html.erb @@ -1,8 +1,15 @@ -

<%= t('devise_views.organizations.registrations.success.title') %>

- -

<%= t('devise_views.organizations.registrations.success.thank_you') %>

- -

<%= t('devise_views.organizations.registrations.success.instructions') %>

- -

<%= link_to t('devise_views.organizations.registrations.success.back_to_index'), root_path %>

- +
+
+
+

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

+

<%= raw t("devise_views.organizations.registrations.success.thank_you") %>

+

<%= raw t("devise_views.organizations.registrations.success.instructions_1") %>

+

<%= raw t("devise_views.organizations.registrations.success.instructions_2") %>

+

<%= raw t("devise_views.organizations.registrations.success.instructions_3") %>

+

+ <%= link_to t("devise_views.organizations.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 394c3611c..0a459ffbf 100644 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -67,13 +67,11 @@ en: password_confirmation_label: "Confirm password" submit: "Sign up" success: - title: "Registration of organization / collective pending verification" - thank_you: "Thank you for registering your organization or collective in the website." - instructions: - We will contact you soon in order to verify that you represent your collective. - Meanwhile, please review your email. We have sent you a confirmation link which you - will have to click in order to activate your account. You will then be able to participate - as a non-verified organization. + title: "Registration of organization / collective" + thank_you: "Thank you for registering your organization or collective in the website. Now is pending verification." + instructions_1: "We will contact you soon in order to verify that you represent your collective." + instructions_2: "Meanwhile, review your email. We have sent you a confirmation link to activate your account." + instructions_3: "When you confirm your account will then be able to participate as a non-verified organization." back_to_index: "Ok, go back to index" sessions: new: diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index e27065038..2d582fde9 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -67,12 +67,11 @@ es: password_confirmation_label: "Confirmar contraseña" submit: "Registrarse" success: - title: "Registro de organización / colectivo pendiente de verificación" - thank_you: "Gracias por registrar tu colectivo en la web." - instructions: - En breve nos pondremos en contacto contigo para verificar que realmente representas a un colectivo. - Entretanto, por favor revisa tu correo electrónico. Te hemos enviado un enlace que debes pulsar para confirmar - tu correo. Una vez confirmado, podrás empezar a participar como colectivo no verificado. + title: "Registro de organización / colectivo" + thank_you: "Gracias por registrar tu colectivo en la web. Ahora está pendiente de verificación." + instructions_1: "En breve nos pondremos en contacto contigo para verificar que realmente representas a este colectivo." + instructions_2: "Mientras revisa tu correo electrónico, te hemos enviado un enlace para confirmartu cuenta." + instructions_3: "Una vez confirmado, podrás empezar a participar como colectivo no verificado." back_to_index: "Entendido, volver a la página principal" sessions: new: From f47fbe82d5b0c6b5ade7f3e3f98e4a0b154dba83 Mon Sep 17 00:00:00 2001 From: kikito Date: Tue, 25 Aug 2015 19:22:57 +0200 Subject: [PATCH 3/3] Uses *_html tags instead of calling raw in the view --- app/views/organizations/registrations/success.html.erb | 8 ++++---- config/locales/devise_views.en.yml | 6 +++--- config/locales/devise_views.es.yml | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/organizations/registrations/success.html.erb b/app/views/organizations/registrations/success.html.erb index d4c0953f6..e246365f5 100644 --- a/app/views/organizations/registrations/success.html.erb +++ b/app/views/organizations/registrations/success.html.erb @@ -2,10 +2,10 @@

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

-

<%= raw t("devise_views.organizations.registrations.success.thank_you") %>

-

<%= raw t("devise_views.organizations.registrations.success.instructions_1") %>

-

<%= raw t("devise_views.organizations.registrations.success.instructions_2") %>

-

<%= raw t("devise_views.organizations.registrations.success.instructions_3") %>

+

<%= t("devise_views.organizations.registrations.success.thank_you") %>

+

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

+

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

+

<%= t("devise_views.organizations.registrations.success.instructions_3_html") %>

<%= link_to t("devise_views.organizations.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 0a459ffbf..f0e1eb33a 100644 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -69,9 +69,9 @@ en: success: title: "Registration of organization / collective" thank_you: "Thank you for registering your organization or collective in the website. Now is pending verification." - instructions_1: "We will contact you soon in order to verify that you represent your collective." - instructions_2: "Meanwhile, review your email. We have sent you a confirmation link to activate your account." - instructions_3: "When you confirm your account will then be able to participate as a non-verified organization." + 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" sessions: new: diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index 2d582fde9..49d304748 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -69,9 +69,9 @@ es: success: title: "Registro de organización / colectivo" thank_you: "Gracias por registrar tu colectivo en la web. Ahora está pendiente de verificación." - instructions_1: "En breve nos pondremos en contacto contigo para verificar que realmente representas a este colectivo." - instructions_2: "Mientras revisa tu correo electrónico, te hemos enviado un enlace para confirmartu cuenta." - instructions_3: "Una vez confirmado, podrás empezar a participar como colectivo no verificado." + instructions_1_html: "En breve nos pondremos en contacto contigo para verificar que realmente representas a este colectivo." + instructions_2_html: "Mientras revisa tu correo electrónico, te hemos enviado un enlace para confirmar tu cuenta." + instructions_3_html: "Una vez confirmado, podrás empezar a participar como colectivo no verificado." back_to_index: "Entendido, volver a la página principal" sessions: new: