From ad9e2cc637fcc833aeb79e6ea9e7797e4ed94a3f Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 26 Aug 2015 20:32:48 +0200 Subject: [PATCH] Adds styles for social share and auth --- app/assets/stylesheets/participacion.scss | 119 ++++++++++++++++++++++ app/views/devise/_omniauth_form.html.erb | 18 ++-- config/locales/devise_views.en.yml | 2 +- config/locales/devise_views.es.yml | 2 +- config/locales/en.yml | 3 + config/locales/es.yml | 3 + 6 files changed, 138 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/participacion.scss b/app/assets/stylesheets/participacion.scss index e20a2cb36..116b57ff8 100644 --- a/app/assets/stylesheets/participacion.scss +++ b/app/assets/stylesheets/participacion.scss @@ -14,6 +14,7 @@ // 12. Official levels // 13. Pagination // 14. Tables +// 15. Social // // 01. Variables @@ -856,4 +857,122 @@ table { } } +// 15. Social +// - - - - - - - - - - - - - - - - - - - - - - - - - +.button.button-twitter { + background: #45B0E3; + + &:before { + background: #40A2D1; + content: "f"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 0; + line-height: $line-height*2; + padding: 0 rem-calc(20); + position: absolute; + top: 0; + } +} + +.social-share-button-twitter { + background: #45B0E3; + color: white; + height: rem-calc(48); + position: relative; + width: rem-calc(48); + + &:before { + content: "f"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 50%; + line-height: $line-height*2; + margin-left: rem-calc(-11); + position: absolute; + top: 0; + } + + &:hover { + color: #40A2D1; + } +} + +.button.button-facebook { + background: #3B5998; + + &:before { + background: #354F88; + content: "A"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 0; + line-height: $line-height*2; + padding: 0 rem-calc(20); + position: absolute; + top: 0; + } +} + +.social-share-button-facebook { + background: #3B5998; + color: white; + height: rem-calc(48); + position: relative; + width: rem-calc(48); + + &:before { + content: "A"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 50%; + line-height: $line-height*2; + margin-left: rem-calc(-11); + position: absolute; + top: 0; + } + + &:hover { + color: #354F88; + } +} + +.button.button-google { + background: #DE4C34; + + &:before { + background: #CE3E26; + content: "B"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 0; + line-height: $line-height*2; + padding: 0 rem-calc(20); + position: absolute; + top: 0; + } +} + +.social-share-button-google_plus { + background: #DE4C34; + color: white; + height: rem-calc(48); + position: relative; + width: rem-calc(48); + + &:before { + content: "B"; + font-family: "icons" !important; + font-size: rem-calc(24); + left: 50%; + line-height: $line-height*2; + margin-left: rem-calc(-11); + position: absolute; + top: 0; + } + + &:hover { + color: #CE3E26; + } +} diff --git a/app/views/devise/_omniauth_form.html.erb b/app/views/devise/_omniauth_form.html.erb index fdd812b4f..63e73d160 100644 --- a/app/views/devise/_omniauth_form.html.erb +++ b/app/views/devise/_omniauth_form.html.erb @@ -1,7 +1,11 @@ -
- -<%= link_to t("omniauth.twitter.sign_in"), user_omniauth_authorize_path(:twitter), class: 'button radius expand' %> -<%= link_to t("omniauth.facebook.sign_in"), user_omniauth_authorize_path(:facebook), class: 'button radius expand' %> -<%= link_to t("omniauth.google_oauth2.sign_in"), user_omniauth_authorize_path(:google_oauth2), class: 'button radius expand' %> - -
+<% if current_page?(new_user_session_path) %> + <%= link_to t("omniauth.twitter.sign_in"), user_omniauth_authorize_path(:twitter), class: "button-twitter button radius expand" %> + <%= link_to t("omniauth.facebook.sign_in"), user_omniauth_authorize_path(:facebook), class: "button-facebook button radius expand" %> + <%= link_to t("omniauth.google_oauth2.sign_in"), user_omniauth_authorize_path(:google_oauth2), class: "button-google button radius expand" %> +
+<% elsif current_page?(new_user_registration_path) %> + <%= link_to t("omniauth.twitter.sign_up"), user_omniauth_authorize_path(:twitter), class: "button-twitter button radius expand" %> + <%= link_to t("omniauth.facebook.sign_up"), user_omniauth_authorize_path(:facebook), class: "button-facebook button radius expand" %> + <%= link_to t("omniauth.google_oauth2.sign_up"), user_omniauth_authorize_path(:google_oauth2), class: "button-google button radius expand" %> +
+<% end %> \ No newline at end of file diff --git a/config/locales/devise_views.en.yml b/config/locales/devise_views.en.yml index f0e1eb33a..e6f573cf3 100644 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -55,7 +55,7 @@ en: password_label: "Password" password_confirmation_label: "Confirm password" submit: "Sign up" - organization_signup: "Do you represent an organization / group?" + organization_signup: "Do you represent an organization / group? Enter here" organizations: registrations: new: diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index 49d304748..f955938d4 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -55,7 +55,7 @@ es: password_label: "Contraseña" password_confirmation_label: "Confirmar contraseña" submit: "Registrarse" - organization_signup: "¿Representas a una organización / colectivo?" + organization_signup: "¿Representas a una organización / colectivo? Entra aquí" organizations: registrations: new: diff --git a/config/locales/en.yml b/config/locales/en.yml index 322cf585f..049f15435 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -152,7 +152,10 @@ en: title: Add Email twitter: sign_in: Sign in with Twitter + sign_up: Sign up with Twitter facebook: sign_in: Sign in with Facebook + sign_up: Sign up with Facebook google_oauth2: sign_in: Sign in with Google + sign_up: Sign up with Google diff --git a/config/locales/es.yml b/config/locales/es.yml index 5c21c039e..58ae07441 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -152,7 +152,10 @@ es: title: Añade tu email twitter: sign_in: Entra con Twitter + sign_up: Regístrate con Twitter facebook: sign_in: Entra con Facebook + sign_up: Regístrate con Facebook google_oauth2: sign_in: Entra con Google + sign_up: Regístrate con Google