From 0ee36ca0229ac865fd0939555e2264dd39c7fcdc Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 25 Apr 2016 12:35:43 +0200 Subject: [PATCH] refactor interface for SSO profile completion --- .../javascripts/controllers/profile.coffee | 8 + app/assets/stylesheets/app.components.scss | 14 ++ app/assets/stylesheets/app.utilities.scss | 18 +- app/assets/templates/profile/_token.html.erb | 2 +- .../templates/profile/complete.html.erb | 164 ++++++++++-------- config/locales/app.logged.en.yml | 3 +- config/locales/app.logged.fr.yml | 3 +- 7 files changed, 134 insertions(+), 78 deletions(-) diff --git a/app/assets/javascripts/controllers/profile.coffee b/app/assets/javascripts/controllers/profile.coffee index a19968e18..0be3212c2 100644 --- a/app/assets/javascripts/controllers/profile.coffee +++ b/app/assets/javascripts/controllers/profile.coffee @@ -124,6 +124,14 @@ Application.Controllers.controller "CompleteProfileController", ["$scope", "$roo return duplicate[1] email + ## + # Test if the user's mail is marked as duplicate + # @return {boolean} + ## + $scope.hasDuplicate = -> + email = memberPromise.email + if email + return (email.match(/^<([^>]+)>.{20}-duplicate$/) == null) ### PRIVATE SCOPE ### diff --git a/app/assets/stylesheets/app.components.scss b/app/assets/stylesheets/app.components.scss index d504d954a..c48cb3ecf 100644 --- a/app/assets/stylesheets/app.components.scss +++ b/app/assets/stylesheets/app.components.scss @@ -464,3 +464,17 @@ padding: 10px; display: none; } } + +.disabling-overlay { + &:before { + content: ""; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: rgba(230, 230, 230, 0.7); + position: absolute; + z-index:10; + border-radius: 3px; + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/app.utilities.scss b/app/assets/stylesheets/app.utilities.scss index 962289652..c91243505 100644 --- a/app/assets/stylesheets/app.utilities.scss +++ b/app/assets/stylesheets/app.utilities.scss @@ -10,19 +10,35 @@ .font-felt { font-family: $font-felt; } p.font-felt { - + } p, .widget p { &.font-felt, .font-felt { font-size: rem-calc(18) !important; } &.fleche-left { position: relative; padding-left: 5px; + span.or { + border: 2px solid $yellow; + border-radius: 50%; + padding: 10px 17px 10px 17px; + } } img.fleche-left { position: absolute; left: -35px; top: 15px; } + img.fleche-right { + position: absolute; + right: -35px; + top: 15px; + } + img.fleche-left-from-top { + transform: rotate(90deg) scaleX(-1); + } + img.fleche-right-from-top { + transform: rotate(270deg) + } } .pos-rlt{position: relative;} diff --git a/app/assets/templates/profile/_token.html.erb b/app/assets/templates/profile/_token.html.erb index 5b8330480..2fb68c319 100644 --- a/app/assets/templates/profile/_token.html.erb +++ b/app/assets/templates/profile/_token.html.erb @@ -1,7 +1,7 @@

{{ 'do_you_already_have_an_account' }}

-

{{ 'do_not_fill_the_form_below_but_specify_here_the_code_you_ve_received_by_email_to_recover_your_access' }}

+

{{ 'do_not_fill_the_form_beside_but_specify_here_the_code_you_ve_received_by_email_to_recover_your_access' }}

diff --git a/app/assets/templates/profile/complete.html.erb b/app/assets/templates/profile/complete.html.erb index 91d4c4bed..96c9b0572 100644 --- a/app/assets/templates/profile/complete.html.erb +++ b/app/assets/templates/profile/complete.html.erb @@ -21,85 +21,101 @@
-
-
-
- {{ 'you_ve_just_created_a_new_account_on_the_fablab_by_logging_from' | translate:{ GENDER: nameGenre, NAME: fablabName }:"messageformat" }}
- - {{activeProvider.name}} ({{ssoEmail()}})
-

{{ 'before_letting_you_use_the_application_we_need_some_more_details' | translate }}.
- {{ 'please_fill_the_following_form' | translate }}. - {{ 'some_data_may_have_already_been_provided_by_provider_and_cannot_be_modified' | translate:{NAME:activeProvider.name} }}. - {{ 'then_click_on_' | translate }} {{ 'confirm_changes' }} {{ '_to_start_using_the_application' | translate }}.

-
-
-
- -
- -
- -
- -
- -
- - - -
-
-
- -
-
- - -
- {{ 'user_s_profile_is_required' }} -
- - -
- {{ 'i_authorize_Fablab_users_registered_on_the_site_to_contact_me' | translate }} -
- - -
- {{ 'i_ve_read_and_i_accept_' | translate }} {{ '_the_fablab_policy' }} -
-
+
+
+
+
+ {{ 'you_ve_just_created_a_new_account_on_the_fablab_by_logging_from' | translate:{ GENDER: nameGenre, NAME: fablabName }:"messageformat" }}
+ + {{activeProvider.name}} ({{ssoEmail()}})
+

{{ 'before_letting_you_use_the_application_we_need_some_more_details' | translate }}.

+
+
+
+
+

+ <%= image_tag("fleche-left.png", class: 'fleche-left visible-lg fleche-left-from-top') %> + {{ 'or' }} + <%= image_tag("fleche-left.png", class: 'fleche-right visible-lg fleche-right-from-top') %> +

+
+
+
+
+
+
+

{{ 'new_on_this_platform' }}

+

{{ 'please_fill_the_following_form'}}.

+

{{ 'some_data_may_have_already_been_provided_by_provider_and_cannot_be_modified' | translate:{NAME:activeProvider.name} }}.
+ {{ 'then_click_on_' | translate }} {{ 'confirm_changes' }} {{ '_to_start_using_the_application' | translate }}.

+
+ -
+
+ +
+ + + +
+
+
+ +
+
+ + +
+ {{ 'user_s_profile_is_required' }} +
+ + +
+ {{ 'i_authorize_Fablab_users_registered_on_the_site_to_contact_me' | translate }} +
+ + +
+ {{ 'i_ve_read_and_i_accept_' | translate }} {{ '_the_fablab_policy' }} +
+
+
+ +
-
+ +
-
- - +
+
+ +
+
diff --git a/config/locales/app.logged.en.yml b/config/locales/app.logged.en.yml index 440fad741..f71fb3246 100644 --- a/config/locales/app.logged.en.yml +++ b/config/locales/app.logged.en.yml @@ -10,8 +10,9 @@ en: some_data_may_have_already_been_provided_by_provider_and_cannot_be_modified: "Some data may have already been provided by {{NAME}} and cannot be modified" # angular interpolation then_click_on_: "Then click on" _to_start_using_the_application: "to start using the application" + new_on_this_platform: "New on this platform?" do_you_already_have_an_account: "Do you already have an account?" - do_not_fill_the_form_below_but_specify_here_the_code_you_ve_received_by_email_to_recover_your_access: "Do not fill the form below but specify here the code you've received by email, to recover your access" + do_not_fill_the_form_beside_but_specify_here_the_code_you_ve_received_by_email_to_recover_your_access: "Do not fill the form beside but specify here the code you've received by email, to recover your access" authentification_code: "Authentification code" confirm_my_code: "Confirm my code" an_unexpected_error_occurred_check_your_authentication_code: "An unexpected error occurred, please check your authentication code." diff --git a/config/locales/app.logged.fr.yml b/config/locales/app.logged.fr.yml index f53c75187..8bf232356 100644 --- a/config/locales/app.logged.fr.yml +++ b/config/locales/app.logged.fr.yml @@ -10,8 +10,9 @@ fr: some_data_may_have_already_been_provided_by_provider_and_cannot_be_modified: "Certaines informations peuvent nous avoir été déjà fournies par {{NAME}} et ne sont pas modifiables" # angular interpolation then_click_on_: "Cliquez ensuite sur" _to_start_using_the_application: "pour commencer à utiliser l'application" + new_on_this_platform: "Nouveau sur cette plate-forme ?" do_you_already_have_an_account: "Vous possédez déjà un compte ?" - do_not_fill_the_form_below_but_specify_here_the_code_you_ve_received_by_email_to_recover_your_access: "Ne remplissez pas le formulaire ci-dessous mais indiquez ici le code qui vous a été fourni par e-mail, cela vous permettra de récupérer l'accès à votre compte." + do_not_fill_the_form_beside_but_specify_here_the_code_you_ve_received_by_email_to_recover_your_access: "Ne remplissez pas le formulaire à gauche mais indiquez ici le code qui vous a été fourni par e-mail, cela vous permettra de récupérer l'accès à votre compte." authentification_code: "Code d'authentification" confirm_my_code: "Valider mon code" an_unexpected_error_occurred_check_your_authentication_code: "Une erreur inattendue est survenue, vérifiez votre code d'authentification."