mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-27 06:05:19 +00:00
Getting a success message in place
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
window.ForgotSidebarCtrl = Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location, SpreeUser) ->
|
||||
$scope.spree_user = SpreeUser.spree_user
|
||||
$scope.sent = false
|
||||
|
||||
$scope.active = ->
|
||||
$location.path() == '/forgot'
|
||||
@@ -10,9 +11,7 @@ window.ForgotSidebarCtrl = Darkswarm.controller "ForgotSidebarCtrl", ($scope, $h
|
||||
$scope.submit = ->
|
||||
if $scope.spree_user.email != null
|
||||
$http.post("/user/spree_user/password", {spree_user: $scope.spree_user}).success (data)->
|
||||
|
||||
$location.path("/reset")
|
||||
|
||||
$scope.sent = true
|
||||
.error (data) ->
|
||||
$scope.errors = "Email address not found"
|
||||
else
|
||||
|
||||
@@ -4,18 +4,26 @@
|
||||
select: "select()"}
|
||||
|
||||
%form{"ng-submit" => "submit()"}
|
||||
.alert-box.alert{"ng-show" => "errors != null"}
|
||||
{{ errors }}
|
||||
|
||||
.row
|
||||
.large-12.columns
|
||||
%label{for: "email"} Email
|
||||
%input.title.input-text{name: "email",
|
||||
type: "email",
|
||||
tabindex: 1,
|
||||
"ng-model" => "spree_user.email"}
|
||||
.row
|
||||
.large-12.columns
|
||||
%input.button.primary{name: "commit",
|
||||
tabindex: "3",
|
||||
type: "submit",
|
||||
value: "Reset password"}
|
||||
.alert-box.success.radius{"ng-show" => "sent"}
|
||||
An email with instructions on resetting your password has been sent!
|
||||
|
||||
%div{"ng-show" => "!sent"}
|
||||
.alert-box.alert{"ng-show" => "errors != null"}
|
||||
{{ errors }}
|
||||
|
||||
.row
|
||||
.large-12.columns
|
||||
%label{for: "email"} Email
|
||||
%input.title.input-text{name: "email",
|
||||
type: "email",
|
||||
tabindex: 1,
|
||||
"ng-model" => "spree_user.email"}
|
||||
.row
|
||||
.large-12.columns
|
||||
%input.button.primary{name: "commit",
|
||||
tabindex: "3",
|
||||
type: "submit",
|
||||
value: "Reset password"}
|
||||
|
||||
Reference in New Issue
Block a user