diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-07-24 18:18:50 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-07-24 18:18:50 +0200 |
| commit | ec92c9432cf452badb6cca2c41e41d0546006692 (patch) | |
| tree | 9b0ebc256d9dfda52586f4d59bf4d56aac04a8b0 /StoneIsland/www/js/lib/auth/SignupView.js | |
| parent | a0b5692d077544ea2f44b41ed72f0b3c26b3dcf6 (diff) | |
many updates. consent modal
Diffstat (limited to 'StoneIsland/www/js/lib/auth/SignupView.js')
| -rwxr-xr-x | StoneIsland/www/js/lib/auth/SignupView.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js index ed702a03..3612abe7 100755 --- a/StoneIsland/www/js/lib/auth/SignupView.js +++ b/StoneIsland/www/js/lib/auth/SignupView.js @@ -49,10 +49,11 @@ 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.", + "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 agree to data profiling.", + "DataProfiling": "You must consent to data profiling to use the Stone Island app.", + "AccountTerms": "You must agree to the Your My Account terms.", }, validate_fields: function(data, errors){ @@ -62,8 +63,18 @@ 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 use this service." ]) } - if (! data.BirthDay) data.BirthDay = '1900-01-01' + if (data.DataProfiling !== "true") { errors.push([ "DataProfiling", "You must consent to data profiling to use the Stone Island app." ]) } + if (data.AccountTerms !== "true") { errors.push([ "AccountTerms", "You must agree to the Your My Account terms to use the Stone Island app." ]) } + + var now = new Date () + var year = now.getFullYear() + if (! data.Birthday) data.BirthDay = year + '-01-01' + if (data.BirthDay.split('-')[0] || '2018') + var birthday = new Date (data.BirthDay) + if (isNaN(birthday) || (now - 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") }, |
