diff --git a/app/assets/javascripts/darkswarm/controllers/signup_sidebar_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/signup_sidebar_controller.js.coffee index bb24643f0c..0a11bbbcdf 100644 --- a/app/assets/javascripts/darkswarm/controllers/signup_sidebar_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/signup_sidebar_controller.js.coffee @@ -1,5 +1,8 @@ -window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope) -> +window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope, $http) -> $scope.spree_user = {} + $scope.errors = + email: null + password: null $scope.active = -> $scope.active_sidebar == '/signup' @@ -8,4 +11,4 @@ window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope) -> $http.post("/user/spree_user", {spree_user: $scope.spree_user}).success (data)-> location.href = location.origin + location.pathname # Strips out hash fragments .error (data) -> - $scope.errors = data.message + $scope.errors = data diff --git a/app/views/shared/_signup_sidebar.html.haml b/app/views/shared/_signup_sidebar.html.haml index 9664ab80cb..6806524318 100644 --- a/app/views/shared/_signup_sidebar.html.haml +++ b/app/views/shared/_signup_sidebar.html.haml @@ -1,8 +1,6 @@ #sign-up-content{"ng-controller" => "SignupSidebarCtrl", "ng-show" => "active()"} %h2 Signup %form{"ng-submit" => "submit()"} - .alert-box.alert{"ng-show" => "errors != null"} - {{ errors }} .row .large-12.columns %label{for: "email"} Email @@ -10,6 +8,8 @@ type: "email", tabindex: 1, "ng-model" => "spree_user.email"} + %span.error{"ng-show" => "errors.email != null"} + {{ errors.email.join(' ') }} .row .large-12.columns %label{for: "password"} Password @@ -18,6 +18,8 @@ autocomplete: "off", tabindex: 2, "ng-model" => "spree_user.password"} + %span.error{"ng-show" => "errors.password != null"} + {{ errors.password.join(' ') }} .row .large-12.columns %label{for: "password"} Password Confirmation