mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Working signup :)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user