Skip to content

Commit 3339afe

Browse files
Brandon Greenjmjackson6880
Brandon Green
authored andcommitted
Add data policy and logic for checkbox
1 parent b4c0fb2 commit 3339afe

File tree

2 files changed

+53
-13
lines changed

2 files changed

+53
-13
lines changed

_sass/contributors.scss

+34-2
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,40 @@
301301
.contributor-consent-check {
302302
color: $mid_gray;
303303
margin-top: 1rem;
304+
input[type=checkbox] {
305+
display: none;
306+
}
307+
input[type="checkbox"] + *::before {
308+
content: "";
309+
display: inline-block;
310+
vertical-align: bottom;
311+
width: 1.2rem;
312+
height: 1.2rem;
313+
margin-right: 0.3rem;
314+
border-radius: 10%;
315+
border-style: solid;
316+
border-width: 0.1rem;
317+
border-color: gray;
318+
}
319+
input[type="checkbox"]:checked + *::before {
320+
content: "";
321+
color: white;
322+
text-align: center;
323+
background: $orange;
324+
border-color: $orange;
325+
font-size: 14px;
326+
&:hover {
327+
cursor: pointer;
328+
}
329+
}
330+
}
331+
332+
.please-accept-terms {
333+
display: none;
334+
color: $orange;
335+
font-size: 18px;
304336
}
305337

306-
#agree:checked {
307-
background-color: red;
338+
input[type=checkbox]:checked {
339+
background-color: $orange;
308340
}

ecosystem/contributors.html

+19-11
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,21 @@ <h2>Newsletter Sign Up</h2>
5050
<input type="text" name="Email Address">
5151
<input type="submit" value="Submit">
5252
<div class="contributor-consent-check">
53-
<input type="checkbox" id="agree" oninvalid="this.setCustomValidity('Please accept the terms and conditions below')" onvalid="this.setCustomValidity('')" required>
54-
<label for="agree">I accept the terms and conditions below</label>
53+
<input type="checkbox" id="agree" oninvalid="this.setCustomValidity('')" required>
54+
<label for="agree">
55+
<span>I accept the terms and conditions below</span>
56+
</label>
5557
</div>
5658
</form>
5759
<p class="form-success">Thanks! You are now subscribed to the PyTorch Contributors Newsletter.</p>
5860
<p class="form-fail">There was an error submitting your email address. Please try again.</p>
61+
<p class="please-accept-terms">Please accept the terms and conditions below</p>
5962
</div>
6063
<p class="email-consent">
61-
☨Brand Domain (send/server) is from or in NA and ROW excluding EU/EEA
62-
By submitting your email, you agree to receive technical updates and marketing-related electronic communications from Facebook Inc, including news, events, and updates.
63-
You may withdraw your consent and unsubscribe from these at any time, for example, by clicking the unsubscribe link included on our emails.
64-
For more information about how Facebook handles your data, please read our Data Policy
65-
</p>
66-
<p class="email-consent">
67-
☨Brand Domain (send/server) is from or in EU/EEA:
68-
By submitting your email, you agree to receive technical updates and marketing-related electronic communications from Facebook Ireland Limited, including news, events, and updates.
69-
You may withdraw your consent and unsubscribe from these at any time, for example, by clicking the unsubscribe link included on our emails. For more information about how Facebook handles your data, please read our Data Policy.
64+
By submitting your email, you agree to receive technical updates and marketing-related electronic communications from Facebook Inc, and its affiliated businesses, including news, events, and updates.
65+
You may withdraw your consent and unsubscribe from these at any time, for example, by clicking the unsubscribe link included on our emails. For more information about how Facebook handles your data, please read our <a href="https://pytorch.org/assets/tos-oss-privacy-policy/fb-oss-privacy-policy.pdf">Data Policy</a>
7066
</p>
67+
7168
<a id="issue-toggle" class="contributors-button" href="#pytorch-1">View Issues</a>
7269
</div>
7370

@@ -105,4 +102,15 @@ <h2>Join the conversation</h2>
105102
$(".form-success").hide();
106103
$(".form-fail").show();
107104
}
105+
106+
$('input[type=submit]').on("click", function(e) {
107+
var checked = $('input[type=checkbox]').prop('checked');
108+
if (!checked) {
109+
$(".please-accept-terms").show().fadeOut(4000);
110+
e.preventDefault();
111+
}else{
112+
return;
113+
}
114+
});
115+
108116
</script>

0 commit comments

Comments
 (0)