Merge branch 'master' into bom

This commit is contained in:
Rob H
2014-03-28 14:42:15 +11:00
6 changed files with 38 additions and 30 deletions

View File

@@ -1,7 +1,6 @@
window.ForgotSidebarCtrl = Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location) ->
$scope.spree_user = {
email: null
}
window.ForgotSidebarCtrl = Darkswarm.controller "ForgotSidebarCtrl", ($scope, $http, $location, SpreeUser) ->
$scope.spree_user = SpreeUser.spree_user
$scope.sent = false
$scope.active = ->
$location.path() == '/forgot'
@@ -12,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

View File

@@ -1,7 +1,5 @@
window.LoginSidebarCtrl = Darkswarm.controller "LoginSidebarCtrl", ($scope, $http, $location) ->
$scope.spree_user = {
remember_me: 0
}
window.LoginSidebarCtrl = Darkswarm.controller "LoginSidebarCtrl", ($scope, $http, $location, SpreeUser) ->
$scope.spree_user = SpreeUser.spree_user
$scope.active = ->
$location.path() == '/login'

View File

@@ -1,5 +1,5 @@
window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope, $http, $location) ->
$scope.spree_user = {}
window.SignupSidebarCtrl = Darkswarm.controller "SignupSidebarCtrl", ($scope, $http, $location, SpreeUser) ->
$scope.spree_user = SpreeUser.spree_user
$scope.errors =
email: null
password: null

View File

@@ -1,6 +1,6 @@
Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location, OrderCycle) ->
$scope.active = (path)->
if !OrderCycle.selected() and $location.hash() == "" and path == "/about"
if !OrderCycle.selected() and $location.hash() == "" and path == "about"
true
else
$location.hash() == path
@@ -9,10 +9,10 @@ Darkswarm.controller "TabsCtrl", ($scope, $rootScope, $location, OrderCycle) ->
$scope.tabs = ["contact", "about", "groups", "producers"]
for tab in $scope.tabs
$scope[tab] =
path: "/" + tab
path: tab
$scope.select = (tab)->
if $scope.active(tab.path)
$location.hash "/"
$location.hash ""
else
$location.hash tab.path

View File

@@ -0,0 +1,6 @@
Darkswarm.factory 'SpreeUser', ($resource) ->
new class SpreeUser
spree_user: {
remember_me: 0
email: null
}

View File

@@ -3,20 +3,27 @@
active: "active()",
select: "select()"}
{{ spree_user.email }}
%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"}