summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/account
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/account')
-rwxr-xr-xStoneIsland/www/js/lib/account/AccountView.js5
-rwxr-xr-xStoneIsland/www/js/lib/account/ProfileView.js4
2 files changed, 9 insertions, 0 deletions
diff --git a/StoneIsland/www/js/lib/account/AccountView.js b/StoneIsland/www/js/lib/account/AccountView.js
index 80738be0..73637cd1 100755
--- a/StoneIsland/www/js/lib/account/AccountView.js
+++ b/StoneIsland/www/js/lib/account/AccountView.js
@@ -103,13 +103,18 @@ var AccountView = View.extend({
else {
cb && cb()
}
+ console.log('logged in')
if ( ! auth.has_cart() ) {
+ console.log('no cart')
app.curtain.show("loading")
auth.create_cart({
success: function(){
+ console.log('got cart')
if (auth.deferred_product) {
+ console.log('adding deferred product')
auth.add_deferred_product_to_cart({
success: function(){
+ console.log('success!')
app.router.go("cart")
setTimeout(function(){
app.curtain.hide("loading")
diff --git a/StoneIsland/www/js/lib/account/ProfileView.js b/StoneIsland/www/js/lib/account/ProfileView.js
index 52ef8056..ee39374b 100755
--- a/StoneIsland/www/js/lib/account/ProfileView.js
+++ b/StoneIsland/www/js/lib/account/ProfileView.js
@@ -26,6 +26,9 @@ var ProfileView = FormView.extend({
if (auth.user.BirthDay.match(/T/)) {
auth.user.BirthDay = auth.user.BirthDay.split("T")[0]
}
+ if (auth.user.BirthDay === '1900-01-01') {
+ auth.user.BirthDay = ''
+ }
if (auth.user.name && ! auth.user.Name) {
auth.user.Name = auth.user.name
}
@@ -51,6 +54,7 @@ var ProfileView = FormView.extend({
if (! data.CurrentPassword && (data.NewPassword || data.Email !== auth.user.Email)) { errors.push([ "CurrentPassword", "Please enter your current password." ]) }
if (data.CurrentPassword && ! data.NewPassword) { errors.push([ "NewPassword", "Please enter your new password." ]) }
if (data.NewPassword && data.NewPassword.length < 7) { errors.push([ "CurrentPassword", "New password must be 7 characters or more." ]) }
+ if (! data.Birthday) data.BirthDay = '1900-01-01'
// if (data.Gender === "NONE") { errors.push([ "Gender", "Please supply your gender." ]) }
},