-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reCAPTCHA: Elig Index, Elig Confirm - Add reCAPTCHA text, hide flag #2586
base: refactor/recaptcha-copy
Are you sure you want to change the base?
Changes from 15 commits
d81de3e
8a5d4cd
32c9297
7a81aab
d331ca6
129d108
128d28a
29dad70
7479af3
5d34bb4
9cfd2c6
a4e9b6f
1f2ee3e
87f40f7
b21f806
986fc6f
ec05326
dce769c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,41 +3,39 @@ | |
|
||
{% url form.action_url as form_action %} | ||
|
||
<form id="{{ form.id }}" action="{{ form_action }}" method="{{ form.method | default:"post" | upper }}" role="form"> | ||
<form id="{{ form.id }}" | ||
class="col-lg-6 {{ form.classes }}" | ||
action="{{ form_action }}" | ||
method="{{ form.method | default:"post" | upper }}" | ||
role="form"> | ||
{% csrf_token %} | ||
|
||
<div class="row form-container justify-content-center"> | ||
<div class="{{ form.classes }}"> | ||
{% for field in form %} | ||
<div class="row form-group mb-0"> | ||
<div class="col-12"> | ||
{# djlint:off #} | ||
{% if field.label %} | ||
<label for="{{ field.id_for_label }}" class="form-control-label">{{ field.label }}{% if field.field.required %}<span class="required-label text-body">*</span>{% endif %} | ||
</label> | ||
{% endif %} | ||
{# djlint:on #} | ||
|
||
{{ field }} | ||
|
||
{% if field.help_text %}<small class="d-block mt-2 pt-1 form-text text-body">{{ field.help_text }}</small>{% endif %} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
Comment on lines
-9
to
-27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these |
||
<div class="form-field-container d-flex flex-column gap-4"> | ||
{% for field in form %} | ||
<div class="form-group mb-0"> | ||
{# djlint:off #} | ||
{% if field.label %} | ||
<label for="{{ field.id_for_label }}" class="form-control-label">{{ field.label }}{% if field.field.required %}<span class="required-label text-body">*</span>{% endif %} | ||
</label> | ||
{% endif %} | ||
{# djlint:on #} | ||
|
||
{{ field }} | ||
|
||
{% if field.help_text %}<small class="d-block mt-2 pt-1 form-text text-body">{{ field.help_text }}</small>{% endif %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
{% if form.submit_value %} | ||
<div class="row d-flex justify-content-center pt-8"> | ||
<div class="col-lg-6"> | ||
Comment on lines
-31
to
-32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now longer needed. |
||
<button class="btn btn-lg btn-primary spinner-hidden d-flex justify-content-center align-items-center" | ||
data-action="submit" | ||
type="submit" | ||
form="{{ form.id }}"> | ||
<span class="btn-text">{{ form.submit_value }}</span> | ||
<span class="spinner-border spinner-border-sm"></span> | ||
</button> | ||
</div> | ||
<div class="pt-8"> | ||
<button class="btn btn-lg btn-primary spinner-hidden d-flex justify-content-center align-items-center" | ||
data-action="submit" | ||
type="submit" | ||
form="{{ form.id }}"> | ||
<span class="btn-text">{{ form.submit_value }}</span> | ||
<span class="spinner-border spinner-border-sm"></span> | ||
</button> | ||
</div> | ||
{% endif %} | ||
|
||
|
@@ -94,6 +92,8 @@ | |
{% endcomment %} | ||
machikoyasuda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<input type="hidden" name="{{ request.recaptcha.data_field }}" value=""> | ||
|
||
<div class="pt-8">{% include "core/includes/recaptcha-text.html" %}</div> | ||
|
||
<script nonce="{{ request.csp_nonce }}"> | ||
function recaptchaSubmit($event) { | ||
// checks the validity of the form. Return if invalid; HTML5 validation errors should display | ||
|
@@ -121,6 +121,5 @@ | |
$("button[type=submit]", "#{{ form.id }}").on("click", recaptchaSubmit); | ||
</script> | ||
{% endif %} | ||
|
||
</form> | ||
{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% load i18n %} | ||
|
||
<p class="form-text text-body mt-0"> | ||
{% blocktranslate trimmed %} | ||
This site is protected by reCAPTCHA and the Google <a href="https://policies.google.com/privacy" target="_blank" rel="noopener noreferrer">Privacy Policy</a> and <a href="https://policies.google.com/terms" target="_blank" rel="noopener noreferrer">Terms of Service</a> apply. | ||
{% endblocktranslate %} | ||
</p> |
angela-tran marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,11 @@ html { | |
scroll-padding-top: 101px; /* Header Height (80px) + Skip Nav Height (21px) = 101px */ | ||
} | ||
|
||
/* reCAPTCHA: Do not display badge */ | ||
.grecaptcha-badge { | ||
display: none; | ||
} | ||
|
||
body { | ||
font-size: 100%; | ||
color: var(--text-primary-color); | ||
|
@@ -53,6 +58,8 @@ li { | |
margin: 0; | ||
} | ||
|
||
/* Utility Classes */ | ||
|
||
@media (min-width: 992px) { | ||
/* Utility Class: Padding bottom 64px on Desktop */ | ||
/* Pair with pb-4 on Form pages to get 24px on Mobile, 64px on Desktop */ | ||
|
@@ -106,6 +113,11 @@ a:visited:not(.btn) { | |
color: var(--selected-color); | ||
} | ||
|
||
:root { | ||
--external-link-icon-size: var(--font-size-24px); | ||
--external-link-icon-size-small: var(--font-size-18px); | ||
} | ||
|
||
a[target="_blank"]::after { | ||
content: " "; | ||
background-color: currentColor; | ||
|
@@ -119,12 +131,19 @@ a[target="_blank"]::after { | |
|
||
display: inline-block; | ||
position: relative; | ||
width: 24px; | ||
height: 24px; | ||
width: var(--external-link-icon-size); | ||
height: var(--external-link-icon-size); | ||
margin-left: 2px; | ||
vertical-align: text-bottom; | ||
} | ||
|
||
.form-text a[target="_blank"]::after { | ||
width: var(--external-link-icon-size-small); | ||
height: var(--external-link-icon-size-small); | ||
mask-size: contain; | ||
-webkit-mask-size: contain; | ||
} | ||
|
||
/* Headlines */ | ||
/* All headlines */ | ||
h1, | ||
|
@@ -285,6 +304,10 @@ footer { | |
margin-top: 64px; | ||
} | ||
|
||
.eligibility-confirm footer { | ||
margin-top: 24px; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I narrowed down the issue I mentioned in #2586 (comment) for |
||
footer .footer-links li a.footer-link { | ||
color: var(--footer-link-color); | ||
font-weight: var(--footer-link-font-weight); | ||
|
@@ -513,26 +536,18 @@ footer .footer-links li a.footer-link:visited { | |
} | ||
|
||
/* Forms: Text Inputs */ | ||
/* Form Container: Must use .form-container parent to use these styles */ | ||
|
||
:root { | ||
--form-input-gap: calc(24rem / 16); | ||
} | ||
|
||
.form-container .form-group:not(:first-child) { | ||
padding-top: var(--form-input-gap); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the |
||
/* Form Field Container: Must use .form-field-container parent to use these styles */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed this b/c this div is a container around one form field, rather than the entire form. |
||
|
||
.form-container .form-control-label, | ||
.form-container .required-label { | ||
.form-field-container .form-control-label, | ||
.form-field-container .required-label { | ||
font-size: var(--font-size-16px); | ||
font-weight: var(--medium-font-weight); | ||
line-height: var(--form-field-text-line-height); | ||
letter-spacing: calc(var(--font-size-16px) * var(--letter-spacing-5)); | ||
padding-bottom: calc(12rem / 16); | ||
} | ||
|
||
.form-container .form-control { | ||
.form-field-container .form-control { | ||
border-width: var(--border-width); | ||
border-radius: var(--border-radius); | ||
border-color: var(--primary-color); | ||
|
@@ -542,8 +557,8 @@ footer .footer-links li a.footer-link:visited { | |
/* Input height should be 60px */ | ||
} | ||
|
||
.form-container .form-control:focus, | ||
.form-container .form-control:focus-visible { | ||
.form-field-container .form-control:focus, | ||
.form-field-container .form-control:focus-visible { | ||
outline: 3px solid var(--focus-color) !important; | ||
outline-offset: 2px !important; | ||
box-shadow: none !important; | ||
|
@@ -552,7 +567,7 @@ footer .footer-links li a.footer-link:visited { | |
.form-text { | ||
font-size: var(--font-size-14px); | ||
line-height: var(--form-field-text-line-height); | ||
letter-spacing: var(--letter-spacing-5); | ||
letter-spacing: calc(var(--font-size-14px) * var(--letter-spacing-5)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This letter-spacing update affects not just reCAPTCHA text, but the form field helper text as well. It was not updated on Production.
The way this is calculated: In Figma, click on the text. In the Dev resources sidebar, ensure Properties is enabled (instead of Code). Look for the letter spacing percentage: Multiply the percentage with the font size. |
||
} | ||
|
||
/* Forms: Radio Buttons */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a regression in Benefits Admin coming from this change.
We have some styles in
admin/styles.css
so that descendant checkboxes will be on the left side:benefits/benefits/static/css/admin/styles.css
Lines 88 to 103 in dce769c
InPersonEligibilityForm
hascheckbox-parent
in itsclasses
, which would end up on this line, but now it's on the<form>
element.Not sure if we should put this
<div>
back or try to tweak the CSS?(*When we're back in the new year, it'd be good to get all this reCAPTCHA work caught up with the fixes that are in main.)