summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-12-01 06:39:46 -0500
committerJules Laplace <jules@okfoc.us>2015-12-01 06:39:46 -0500
commit1dfdbf6d09c6b1b80011b98436daa010f10a7be3 (patch)
tree44be4184ea36f3a92e2cff99420a15cbb06d993a /StoneIsland/www/js
parent44ba111c40ce50f8634a7e9bb4316315274218cb (diff)
error / thanks styling
Diffstat (limited to 'StoneIsland/www/js')
-rw-r--r--StoneIsland/www/js/lib/auth/SignupView.js9
-rw-r--r--StoneIsland/www/js/lib/cart/CartConfirm.js8
-rw-r--r--StoneIsland/www/js/lib/cart/CartError.js2
-rw-r--r--StoneIsland/www/js/lib/cart/CartPayment.js3
-rw-r--r--StoneIsland/www/js/lib/cart/CartSummary.js2
-rw-r--r--StoneIsland/www/js/lib/cart/CartView.js1
-rw-r--r--StoneIsland/www/js/lib/view/Serializable.js1
7 files changed, 19 insertions, 7 deletions
diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js
index a78af233..bba959bd 100644
--- a/StoneIsland/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/www/js/lib/auth/SignupView.js
@@ -49,6 +49,7 @@ var SignupView = FormView.extend({
"Surname": "Please enter your last name.",
"Email": "Please enter a valid email address.",
"ConfirmEmail": "Please enter a valid email address.",
+ "BirthDay": "Please enter your birthday.",
"Password": "Please enter your password.",
"Password2": "Please enter your password again.",
"DataProfiling": "You must agree to data profiling.",
@@ -99,7 +100,13 @@ var SignupView = FormView.extend({
},
error: function(data){
- console.log('error', data)
+ try {
+ data = JSON.parse(data.responseText)
+ app.signup.show_errors([[ 'Name', data['Error']['Description'] ]])
+ }
+ catch (e) {
+ app.signup.show_errors([[ 'Name', "There was an unknown error." ]])
+ }
},
cancel: function(){
diff --git a/StoneIsland/www/js/lib/cart/CartConfirm.js b/StoneIsland/www/js/lib/cart/CartConfirm.js
index 27e249cf..f6c7f1f5 100644
--- a/StoneIsland/www/js/lib/cart/CartConfirm.js
+++ b/StoneIsland/www/js/lib/cart/CartConfirm.js
@@ -147,7 +147,7 @@ var CartConfirm = FormView.extend({
case 440: // genericapierror (credit card error!)
case 441: // genericapierror (credit card empty)
app.router.go('cart/payment')
- app.cart.payment.show_errors(["Number","There was a problem with your credit card."])
+ app.cart.payment.show_errors([["Number","There was a problem with your credit card."]])
break
}
}.bind(this))
@@ -156,14 +156,14 @@ var CartConfirm = FormView.extend({
finalization_error: function(data){
if (data['Error']['Description'].match(/receiver validation fails/)) {
app.router.go('cart/shipping')
- app.cart.payment.show_errors(["Number","There was a problem with your credit card."])
+ app.cart.payment.show_errors([["Number","There was a problem with your credit card."]])
}
else if (data['Error']['Description'].match(/cart cannot be empty/)) {
app.router.go('cart/summary')
}
else if (data['Error']['Description'].match(/Item has been removed/)) {
- app.router.go('cart/thanks')
- app.cart.thanks.show_error("We're sorry, but one or more items was out of stock. Please check your cart and try again.")
+ app.router.go('cart/error')
+ app.cart.error.show_error("We're sorry, but one or more items was out of stock. Please check your cart and try again.")
}
},
diff --git a/StoneIsland/www/js/lib/cart/CartError.js b/StoneIsland/www/js/lib/cart/CartError.js
index f2edae35..f9a1963e 100644
--- a/StoneIsland/www/js/lib/cart/CartError.js
+++ b/StoneIsland/www/js/lib/cart/CartError.js
@@ -12,7 +12,7 @@ var CartError = View.extend({
show: function(){
document.body.className = "cart"
- app.cart.el.className = "cart_error"
+ app.cart.el.className = "error"
app.footer.show("&lt; BACK TO CART")
app.footer.hide()
},
diff --git a/StoneIsland/www/js/lib/cart/CartPayment.js b/StoneIsland/www/js/lib/cart/CartPayment.js
index 8a803de3..f3c54d55 100644
--- a/StoneIsland/www/js/lib/cart/CartPayment.js
+++ b/StoneIsland/www/js/lib/cart/CartPayment.js
@@ -138,6 +138,7 @@ var CartPayment = FormView.extend({
this.success()
}.bind(this)).error(function(data){
app.curtain.hide("loading")
+ console.log(data)
}.bind(this))
return
@@ -173,7 +174,7 @@ var CartPayment = FormView.extend({
error: function(data){
console.log(data)
- app.cart.payment.show_errors(["Number","There was a problem with your credit card."])
+ app.cart.payment.show_errors([["Number","There was a problem with your credit card."]])
},
cancel: function(){
diff --git a/StoneIsland/www/js/lib/cart/CartSummary.js b/StoneIsland/www/js/lib/cart/CartSummary.js
index f370dc73..ff1e001f 100644
--- a/StoneIsland/www/js/lib/cart/CartSummary.js
+++ b/StoneIsland/www/js/lib/cart/CartSummary.js
@@ -55,6 +55,7 @@ var CartSummary = ScrollableView.extend({
return this.empty()
}
+ this.parent.$steps.show()
this.updateCounts()
this.$rows.empty()
@@ -154,6 +155,7 @@ var CartSummary = ScrollableView.extend({
this.parent.setHeaderCount( 0 )
this.parent.$itemcount.html("0 ITEMS")
this.el.className = "empty"
+ this.parent.$steps.hide()
},
save: function(){
diff --git a/StoneIsland/www/js/lib/cart/CartView.js b/StoneIsland/www/js/lib/cart/CartView.js
index 032b2fed..1b08e418 100644
--- a/StoneIsland/www/js/lib/cart/CartView.js
+++ b/StoneIsland/www/js/lib/cart/CartView.js
@@ -16,6 +16,7 @@ var CartView = View.extend({
this.thanks = new CartThanks ({ parent: this })
this.error = new CartError ({ parent: this })
+ this.$steps = this.$(".steps")
this.$full_msg = this.$(".full_msg")
this.$empty_msg = this.$(".empty_msg")
this.$itemcount = this.$(".itemcount")
diff --git a/StoneIsland/www/js/lib/view/Serializable.js b/StoneIsland/www/js/lib/view/Serializable.js
index 6ef8eda3..f9abd011 100644
--- a/StoneIsland/www/js/lib/view/Serializable.js
+++ b/StoneIsland/www/js/lib/view/Serializable.js
@@ -80,6 +80,7 @@ var SerializableView = View.extend({
},
show_errors: function(errors){
+ console.log(errors)
var msgs = []
errors.forEach(function(e, i){
if (i > 0) { return }