summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/auth/SignupView.js31
1 files changed, 25 insertions, 6 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js b/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
index b16ff887..8ae47728 100755
--- a/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/auth/SignupView.js
@@ -49,7 +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. You must be 18 or older to use the Stone Island app.",
+ // "BirthDay": "Please enter your birthday. You must be 18 or older to use the Stone Island app.",
"Password": "Please enter your password.",
"Password2": "Please enter your password again.",
"DataProfiling": "You must consent to data profiling to use the Stone Island app.",
@@ -63,21 +63,40 @@ var SignupView = FormView.extend({
if (! data.Email.match("@")) { errors.push([ "Email", "Email address is not valid." ]) }
if (data.Email.toLowerCase() !== data.ConfirmEmail.toLowerCase()) { errors.push([ "ConfirmEmail", "Email addresses don't match." ]) }
// if (data.Gender === "NONE") { errors.push([ "Gender", "Please supply your gender." ]) }
- if (data.DataProfiling !== "true") { errors.push([ "DataProfiling", "You must consent to data profiling to use the Stone Island app." ]) }
- if (data.GdprTerms !== "true") { errors.push([ "GdprTerms", "You must agree to the Your My Account terms to use the Stone Island app." ]) }
+ if (data.DataProfiling !== "true") {
+ errors.push([ "DataProfiling", "You must consent to data profiling to use the Stone Island app." ])
+ setTimeout(function(){
+ this.$("#checkbox-shopping-data-profiling-label").closest(".checkbox-row").addClass("error_hilite")
+ }.bind(this), 10)
+ }
+ if (data.GdprTerms !== "true") {
+ errors.push([ "GdprTerms", "You must agree to the Your My Account terms to use the Stone Island app." ])
+ setTimeout(function(){
+ this.$("#checkbox-shopping-account-terms").closest(".checkbox-row").addClass("error_hilite")
+ }.bind(this), 10)
+ }
var now = new Date ()
- var year = now.getFullYear()
+ var year = now.getFullYear() - 18
if (! data.BirthDay) {
data.BirthDay = year + '-01-01'
}
// if (data.BirthDay.split('-')[0] || '2018')
var birthday = new Date (data.BirthDay)
- if (isNaN(birthday) || (new Date () - birthday) / (365*24*60*60*1000) < 18) {
- errors.push(['BirthDay', 'You must be 18 or older to use the Stone Island app.'])
+ if (isNaN(birthday)) {
+ data['BirthDay'] = '1970-01-01'
}
+ // if (isNaN(birthday) || (new Date () - birthday) / (365*24*60*60*1000) < 18) {
+ // errors.push(['BirthDay', 'You must be 18 or older to use the Stone Island app.'])
+ // }
data.YooxLetter = this.$("[name=YooxLetter]").prop("checked")
+ if (!data.YooxLetter) {
+ errors.push([ "YooxLetter", "You must consent to marketing to use the Stone Island app." ])
+ setTimeout(function(){
+ this.$("#checkbox-data-profiling").closest(".checkbox-row").addClass("error_hilite")
+ }.bind(this), 10)
+ }
},
finalize: function(data){