diff --git a/app/assets/javascripts/controllers/profile.coffee b/app/assets/javascripts/controllers/profile.coffee.erb similarity index 87% rename from app/assets/javascripts/controllers/profile.coffee rename to app/assets/javascripts/controllers/profile.coffee.erb index f2f542b31..e883d8dfb 100644 --- a/app/assets/javascripts/controllers/profile.coffee +++ b/app/assets/javascripts/controllers/profile.coffee.erb @@ -1,8 +1,8 @@ 'use strict' -Application.Controllers.controller "CompleteProfileController", ["$scope", "$rootScope", "$state", "$window", "_t", "growl", "CSRF", "Auth", "Member", "settingsPromise", "activeProviderPromise", "groupsPromise", "cguFile", "memberPromise", "Session" -, ($scope, $rootScope, $state, $window, _t, growl, CSRF, Auth, Member, settingsPromise, activeProviderPromise, groupsPromise, cguFile, memberPromise, Session) -> +Application.Controllers.controller "CompleteProfileController", ["$scope", "$rootScope", "$state", "$window", "_t", "growl", "CSRF", "Auth", "Member", "settingsPromise", "activeProviderPromise", "groupsPromise", "cguFile", "memberPromise", "Session", "dialogs" +, ($scope, $rootScope, $state, $window, _t, growl, CSRF, Auth, Member, settingsPromise, activeProviderPromise, groupsPromise, cguFile, memberPromise, Session, dialogs) -> @@ -141,6 +141,28 @@ Application.Controllers.controller "CompleteProfileController", ["$scope", "$roo + ## + # Ask for email confirmation and send the SSO merging token again + # @param $event {Object} jQuery event object + ## + $scope.resendCode = (event) -> + event.preventDefault() + event.stopPropagation() + # TODO show modal only IF email is not mapped to sso OR email = null + dialogs.confirm + templateUrl: '<%= asset_path "profile/resend_code_modal.html" %>' + resolve: + object: -> + email: memberPromise.email + , (email) -> + console.log(email) + # TODO update email + # TODO in every cases, resend email + # TODO growl result + + + + ## # Disconnect and re-connect the user to the SSO to force the synchronisation of the profile's data ## diff --git a/app/assets/templates/profile/_token.html.erb b/app/assets/templates/profile/_token.html.erb index f4a8b0404..3017b18ed 100644 --- a/app/assets/templates/profile/_token.html.erb +++ b/app/assets/templates/profile/_token.html.erb @@ -3,6 +3,7 @@
{{ 'do_not_fill_the_form_beside_but_specify_here_the_code_you_ve_received_by_email_to_recover_your_access' }}
{{ 'just_specify_code_here_to_recover_access' }}
+{{ 'i_did_not_receive_the_code' }}