mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
20 lines
639 B
CoffeeScript
20 lines
639 B
CoffeeScript
window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope, $http, $location, SpreeUser, Navigation) ->
|
|
$scope.spree_user = SpreeUser.spree_user
|
|
$scope.path = "/signup"
|
|
Navigation.paths.push $scope.path
|
|
$scope.errors =
|
|
email: null
|
|
password: null
|
|
|
|
$scope.active = ->
|
|
$location.path() == $scope.path
|
|
|
|
$scope.select = ->
|
|
Navigation.navigate($scope.path)
|
|
|
|
$scope.submit = ->
|
|
$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
|