diff --git a/app/assets/javascripts/darkswarm/controllers/authentication/login_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/authentication/login_controller.js.coffee index 7727798197..ae8841df09 100644 --- a/app/assets/javascripts/darkswarm/controllers/authentication/login_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/authentication/login_controller.js.coffee @@ -11,3 +11,10 @@ Darkswarm.controller "LoginCtrl", ($scope, $http, $window, AuthenticationService .error (data) -> Loading.clear() $scope.errors = data.message || data.error + $scope.user_unconfirmed = (data.error == t('devise.failure.unconfirmed')) + + $scope.resend_confirmation = -> + $http.post("/user/spree_user/confirmation", {spree_user: $scope.spree_user}).success (data)-> + $scope.messages = t('devise.confirmations.send_instructions') + .error (data) -> + $scope.errors = t('devise.confirmations.failed_to_send') \ No newline at end of file diff --git a/app/assets/javascripts/templates/login.html.haml b/app/assets/javascripts/templates/login.html.haml index 79511d8968..9e1265edbd 100644 --- a/app/assets/javascripts/templates/login.html.haml +++ b/app/assets/javascripts/templates/login.html.haml @@ -4,6 +4,10 @@ .large-12.columns .alert-box.alert{"ng-show" => "errors != null"} {{ errors }} + %a{ng: {show: 'user_unconfirmed', click: 'resend_confirmation()'}} + = t('devise.confirmations.resend_confirmation_email') + .alert-box.success{ng: {show: 'messages != null'}} + {{ messages }} .row .large-12.columns %label{for: "email"} {{'email' | t}} diff --git a/app/assets/stylesheets/darkswarm/modal-login.css.scss b/app/assets/stylesheets/darkswarm/modal-login.css.scss index 4b87a7d1d9..80687c645f 100644 --- a/app/assets/stylesheets/darkswarm/modal-login.css.scss +++ b/app/assets/stylesheets/darkswarm/modal-login.css.scss @@ -10,4 +10,16 @@ background: #fff; padding-top: 10px; } + + .alert-box { + a { + color: white; + text-decoration: underline; + + &:hover { + color: rgba(255, 255, 255, 0.7); + text-decoration: underline; + } + } + } } diff --git a/config/locales/en.yml b/config/locales/en.yml index b7cdff8e86..89e99c9562 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -71,6 +71,10 @@ en: email: taken: "There's already an account for this email. Please login or reset your password." devise: + confirmations: + send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." + failed_to_send: "An error occurred whilst sending your confirmation email." + resend_confirmation_email: "Resend confirmation email." user_registrations: spree_user: signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."