diff options
Diffstat (limited to 'StoneIsland')
| -rw-r--r-- | StoneIsland/www/css/cart.css | 15 | ||||
| -rw-r--r-- | StoneIsland/www/index.html | 17 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/auth/SignupView.js | 9 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartConfirm.js | 8 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartError.js | 2 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartPayment.js | 3 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartSummary.js | 2 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/cart/CartView.js | 1 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/view/Serializable.js | 1 |
9 files changed, 41 insertions, 17 deletions
diff --git a/StoneIsland/www/css/cart.css b/StoneIsland/www/css/cart.css index 5b79f010..9fbc54b3 100644 --- a/StoneIsland/www/css/cart.css +++ b/StoneIsland/www/css/cart.css @@ -72,15 +72,24 @@ display: none; } -#cart.thanks #cart_thanks { display: block } #cart_thanks { display: none; } - -#cart.error #cart_error { display: block } #cart_error { display: none; } +#cart.thanks #cart_thanks, +#cart.error #cart_error { + display: flex; + align-items: center; + justify-content: center; +} +#cart .copy { + min-height:50px; + max-width: 50%; + text-align: center; + font-size: 18px; +} .summary-container { top:0px; diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html index 8fb18b76..6b786593 100644 --- a/StoneIsland/www/index.html +++ b/StoneIsland/www/index.html @@ -870,16 +870,19 @@ </div> <div id="cart_thanks"> - <b>THANK YOU</b> - <p> - Please check your inbox for your confirmation email. - </p> + <div class="copy"> + <b>THANK YOU</b> + <p> + Please check your inbox for your confirmation email. + </p> + </div> </div> <div id="cart_error"> - <b>WE'RE SORRY</b> - <p class="errrrrrrrrrrrrrrr"> - </p> + <div class="copy"> + <b>WE'RE SORRY</b> + <p class="errrrrrrrrrrrrrrr"></p> + </div> </div> </div> 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("< 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 } |
