diff --git a/functions/utilities/privacy/privacyKeys.js b/functions/utilities/privacy/privacyKeys.js index 67f7dff2..73b905f8 100644 --- a/functions/utilities/privacy/privacyKeys.js +++ b/functions/utilities/privacy/privacyKeys.js @@ -1,6 +1,8 @@ /* * -* YOU MUST update these values in parallel-squared repo as well as here: +* YOU MUST also update these values in +* parallel-squared repo +* static/scripts/user.js in this repo * */ diff --git a/functions/views/_layout.pug b/functions/views/_layout.pug index 3a320b3b..6a84ab82 100644 --- a/functions/views/_layout.pug +++ b/functions/views/_layout.pug @@ -140,16 +140,16 @@ html else article(class=(sidebarDisabled ? 'sidebarDisabled' : '')): block content - if user && !user.acceptedTerms && path !== '/privacy-notice' - #accept-terms.modal - .modal-background - .modal-body - h2 Privacy Updates - form(v-on:submit="user.acceptTerms") - p.checkbox - input#terms-modal(type="checkbox" required) - label(for="terms-modal") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Data Privacy policy]. - button(type="submit") Continue + //- if user && !user.acceptedTerms && path !== '/privacy-notice' + //- #accept-terms.modal + //- .modal-background + //- .modal-body + //- h2 Privacy Updates + //- form(v-on:submit="user.acceptTerms") + //- p.checkbox + //- input#terms-modal(type="checkbox" required) + //- label(for="terms-modal") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Data Privacy policy]. + //- button(type="submit") Continue if user && !user.code && user.showWelcomeMsg .modal(v-if="showWelcomeMsg") diff --git a/functions/views/signup.pug b/functions/views/signup.pug index a603e41c..8effc33f 100644 --- a/functions/views/signup.pug +++ b/functions/views/signup.pug @@ -72,7 +72,7 @@ block content span {{user.signupForm.messages[user.signupForm.type].yearOfBirth}} select(v-model="user.signupForm.birthYear") - var year = 1920; - while year < 2019 + while year < 2024 option= year++ label(v-if="user.signupForm.type === 'teacher'") @@ -93,8 +93,10 @@ block content div(class="info") {{user.signupForm.messages[user.signupForm.type].emailOfParentSubtext}} input(type="email" v-model="user.signupForm.guardianEmail" required) - p.checkbox + p.checkbox(v-if="!user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") input#terms(type="checkbox" required) - label(for="terms") We will email you when a new Parallelogram challenge is released, when the next Parallel Circles session is scheduled, and when there are special competitions, prizes and opportunities. By checking this box you consent to receiving these emails, in accordance with our #[a(href="/privacy-notice" target="_blank") Privacy Notice]. + label(for="terms") We will email you with updates on Parallelograms, Parallel Circles and other offerings from Parallel. By checking this box you consent to receiving these emails, and also confirm that you have read and accept our #[a(href="/privacy-notice" target="_blank") Privacy Notice]. + + p(class="under13Terms" v-if="user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)") As this student is under the age of 13, we require a parent or guardian to read and accept our Privacy Notice. We will be in touch via the parent/guardian email address you have provided above. The Privacy Notice will need to be accepted within 7 days and the student can continue to access the Parallel website in the meantime. button(type="submit") Sign up diff --git a/static/scripts/user.js b/static/scripts/user.js index f2dd5ba8..5d2563cb 100755 --- a/static/scripts/user.js +++ b/static/scripts/user.js @@ -2,7 +2,9 @@ // Parallel Login // ============================================================================= - +const latestPrivacyVersion = 'privacy-sept-2025-001'; +const acceptedKey = `${latestPrivacyVersion}-accepted`; +const acceptedByKey = `${latestPrivacyVersion}-acceptedBy`; const ERRORS = { 'auth/invalid-email': 'This email address is invalid.', @@ -129,7 +131,7 @@ export default function() { const passwordForm = {loading: false, error: ''}; const signupForm = {error: null, loading: false, level: 'year6', - birthYear: 2000, type: location.hash === '#teacher' ? 'teacher' : 'student', primaryEmailType: null, messages: {}}; + birthYear: 2010, type: location.hash === '#teacher' ? 'teacher' : 'student', primaryEmailType: null, messages: {}}; signupForm.messages.student = { firstName: "Student first name", @@ -487,6 +489,13 @@ export default function() { let primaryEmailType = signupForm.type === 'teacher' ? 'teacher' : signupForm.primaryEmailType + const isUnder13 = signupForm.birthYear ? user.isUnderThirteen(signupForm.birthYear, signupForm.birthMonth) : false; + + const privacyData = isUnder13 ? {} : { + [acceptedKey]: Date.now(), + [acceptedByKey]: 'student-signup' + } + const signupData = { first: signupForm.first || null, last: signupForm.last || null, @@ -500,6 +509,7 @@ export default function() { postCode: signupForm.postCode || null, guardianEmail, acceptedTerms: true, + ...privacyData, userReference: generateUserReference(), primaryEmailType, source: window.SIGNUP_SOURCE || null diff --git a/static/styles/forms.less b/static/styles/forms.less index e1a58abb..37bd201d 100644 --- a/static/styles/forms.less +++ b/static/styles/forms.less @@ -107,6 +107,10 @@ .info { display: inline-block; } + .under13Terms { + font-size: 16px; + color: inherit; + } .radio-label { display: inline-block; font-size: 16px;