Skip to content

Commit 5cad176

Browse files
authored
Privacy signup form (#86)
* privacy-signup-form * 🔧 Continue to implement and debug * 🔧 Continue to implement and debug * 🔧 Continue to implement and debug * 🔧 Continue to implement and debug
1 parent c93b1c2 commit 5cad176

File tree

5 files changed

+34
-16
lines changed

5 files changed

+34
-16
lines changed

functions/utilities/privacy/privacyKeys.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
*
3-
* YOU MUST update these values in parallel-squared repo as well as here:
3+
* YOU MUST also update these values in
4+
* parallel-squared repo
5+
* static/scripts/user.js in this repo
46
*
57
*/
68

functions/views/_layout.pug

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,16 @@ html
140140
else
141141
article(class=(sidebarDisabled ? 'sidebarDisabled' : '')): block content
142142

143-
if user && !user.acceptedTerms && path !== '/privacy-notice'
144-
#accept-terms.modal
145-
.modal-background
146-
.modal-body
147-
h2 Privacy Updates
148-
form(v-on:submit="user.acceptTerms")
149-
p.checkbox
150-
input#terms-modal(type="checkbox" required)
151-
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].
152-
button(type="submit") Continue
143+
//- if user && !user.acceptedTerms && path !== '/privacy-notice'
144+
//- #accept-terms.modal
145+
//- .modal-background
146+
//- .modal-body
147+
//- h2 Privacy Updates
148+
//- form(v-on:submit="user.acceptTerms")
149+
//- p.checkbox
150+
//- input#terms-modal(type="checkbox" required)
151+
//- 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].
152+
//- button(type="submit") Continue
153153
154154
if user && !user.code && user.showWelcomeMsg
155155
.modal(v-if="showWelcomeMsg")

functions/views/signup.pug

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ block content
7272
span {{user.signupForm.messages[user.signupForm.type].yearOfBirth}}
7373
select(v-model="user.signupForm.birthYear")
7474
- var year = 1920;
75-
while year < 2019
75+
while year < 2024
7676
option= year++
7777

7878
label(v-if="user.signupForm.type === 'teacher'")
@@ -93,8 +93,10 @@ block content
9393
div(class="info") {{user.signupForm.messages[user.signupForm.type].emailOfParentSubtext}}
9494
input(type="email" v-model="user.signupForm.guardianEmail" required)
9595

96-
p.checkbox
96+
p.checkbox(v-if="!user.isUnderThirteen(user.signupForm.birthYear, user.signupForm.birthMonth)")
9797
input#terms(type="checkbox" required)
98-
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].
98+
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].
99+
100+
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.
99101

100102
button(type="submit") Sign up

static/scripts/user.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
// Parallel Login
33
// =============================================================================
44

5-
5+
const latestPrivacyVersion = 'privacy-sept-2025-001';
6+
const acceptedKey = `${latestPrivacyVersion}-accepted`;
7+
const acceptedByKey = `${latestPrivacyVersion}-acceptedBy`;
68

79
const ERRORS = {
810
'auth/invalid-email': 'This email address is invalid.',
@@ -129,7 +131,7 @@ export default function() {
129131

130132
const passwordForm = {loading: false, error: ''};
131133
const signupForm = {error: null, loading: false, level: 'year6',
132-
birthYear: 2000, type: location.hash === '#teacher' ? 'teacher' : 'student', primaryEmailType: null, messages: {}};
134+
birthYear: 2010, type: location.hash === '#teacher' ? 'teacher' : 'student', primaryEmailType: null, messages: {}};
133135

134136
signupForm.messages.student = {
135137
firstName: "Student first name",
@@ -487,6 +489,13 @@ export default function() {
487489

488490
let primaryEmailType = signupForm.type === 'teacher' ? 'teacher' : signupForm.primaryEmailType
489491

492+
const isUnder13 = signupForm.birthYear ? user.isUnderThirteen(signupForm.birthYear, signupForm.birthMonth) : false;
493+
494+
const privacyData = isUnder13 ? {} : {
495+
[acceptedKey]: Date.now(),
496+
[acceptedByKey]: 'student-signup'
497+
}
498+
490499
const signupData = {
491500
first: signupForm.first || null,
492501
last: signupForm.last || null,
@@ -500,6 +509,7 @@ export default function() {
500509
postCode: signupForm.postCode || null,
501510
guardianEmail,
502511
acceptedTerms: true,
512+
...privacyData,
503513
userReference: generateUserReference(),
504514
primaryEmailType,
505515
source: window.SIGNUP_SOURCE || null

static/styles/forms.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@
107107
.info {
108108
display: inline-block;
109109
}
110+
.under13Terms {
111+
font-size: 16px;
112+
color: inherit;
113+
}
110114
.radio-label {
111115
display: inline-block;
112116
font-size: 16px;

0 commit comments

Comments
 (0)