Skip to content
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

STENCIL-2934 Add recaptcha v2 support to cornerstone. #951

Merged
merged 1 commit into from
Mar 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Implement lazyloading for product card images to improve above-the-fold rendering [#944](https://github.com/bigcommerce/stencil/pull/944)
- Print a readable error instead of dumping the whole error object to the console [#950](https://github.com/bigcommerce/cornerstone/pull/950)
- Fixed homepage featured products floating left and unecessarily wrapping to next row [#948](https://github.com/bigcommerce/cornerstone/pull/948)
- Add google recaptcha v2 support to cornerstone. [#951](https://github.com/bigcommerce/cornerstone/pull/951)

## 1.5.3 (2017-02-23)
- Show 'Write a Review' link for mobile [#922](https://github.com/bigcommerce/stencil/pull/922)
Expand Down
5 changes: 0 additions & 5 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@
},
"create_account": {
"heading": "New Account",
"captcha_heading": "Security Question",
"created": {
"heading": "Your account has been created",
"intro": "Thank you for creating your account at {store_name}. Your account details have been emailed to <strong>{email}</strong>",
Expand Down Expand Up @@ -469,8 +468,6 @@
"phone": "Phone Number",
"order": "Order Number",
"rma": "RMA Number",
"captcha": "Are you human?",
"captcha_desc": "Please copy the characters from the image into the text field below. Doing this helps us prevent automated submissions.",
"question": "Comments/Questions",
"submit": "Submit Form",
"successful": "We've received your feedback and will respond shortly if required. <a href=\"{shopPath}\">Continue</a>."
Expand Down Expand Up @@ -581,12 +578,10 @@
"new": "New Products",
"warranty": "Warranty Information",
"reviews": {
"captcha_heading": "Security Question",
"hide": "Hide Reviews",
"new": "Write a Review",
"show": "Show Reviews",
"header": "{total, plural, =0{0 Reviews} one {# Review} other {# Reviews}}",
"rating": "Rating",
"link_to_review": "({total, plural, =0{No reviews yet} one {# review} other {# reviews}})",
"post_on_by": "Posted by { name } on { date }",
"rating_label": "Rating",
Expand Down
22 changes: 2 additions & 20 deletions templates/components/page/contact-us-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,15 @@
{{/if}}
</div>

{{#if forms.contact.recaptcha.enabled}}
<div class="panel">
<header class="panel-header">
<h3 class="panel-title">{{lang 'forms.contact_us.captcha'}}</h3>
</header>
<div class="panel-body">
<script type="text/javascript"
src="https://www.google.com/recaptcha/api/challenge?k={{forms.contact.recaptcha.public_key}}">
</script>
<noscript>
<iframe src="https://www.google.com/recaptcha/api/noscript?k={{forms.contact.recaptcha.public_key}}" height="300" width="500" frameborder="0"></iframe>
<br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">
</noscript>
</div>
</div>
{{/if}}

<div class="form-field">
<label class="form-label" for="contact_question">{{lang 'forms.contact_us.question'}}
<small>{{lang 'common.required' }}</small>
</label>
<textarea name="contact_question" id="contact_question" rows="5" cols="50" class="form-input"></textarea>
</div>

{{{forms.contact.recaptcha.markup}}}

<div class="form-actions">
<input class="button button--primary" type="submit" value="{{lang 'forms.contact_us.submit' }}">
</div>
Expand Down
19 changes: 1 addition & 18 deletions templates/components/products/modals/writeReview.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,7 @@ <h5 class="product-title">{{ product.title }}</h5>
<!-- Comments -->
{{> components/common/forms/multiline name="revtext" required="true" label=(lang 'products.reviews.form_write.comments')}}

{{#if product.reviews.captcha}}
<header class="panel-header">
<h3 class="panel-title">{{lang 'products.reviews.captcha_heading' }}</h3>
</header>
<div class="panel-body">
<script type="text/javascript"
src="https://www.google.com/recaptcha/api/challenge?k={{product.reviews.captcha}}">
</script>
<noscript>
<iframe src="https://www.google.com/recaptcha/api/noscript?k={{product.reviews.captcha}}"
height="300" width="500" frameborder="0"></iframe>
<br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">
</noscript>
</div>
{{/if}}
{{{product.reviews.recaptcha.markup}}}

<div class="form-field">
<input type="submit" class="button button--primary"
Expand Down
20 changes: 1 addition & 19 deletions templates/pages/auth/create-account.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,7 @@ <h1 class="page-heading">{{lang 'create_account.heading' }}</h1>
{{inject 'required' (lang 'common.required')}}
{{inject 'state_error' (lang 'errors.state_error')}}
</div>
{{#if forms.create_account.recaptcha.enabled }}
<div class="panel">
<header class="panel-header">
<h3 class="panel-title">{{lang 'create_account.captcha_heading' }}</h3>
</header>
<div class="panel-body">
<script type="text/javascript"
src="https://www.google.com/recaptcha/api/challenge?k={{forms.create_account.recaptcha.public_key}}">
</script>
<noscript>
<iframe src="https://www.google.com/recaptcha/api/noscript?k={{forms.create_account.recaptcha.public_key}}" height="300" width="500" frameborder="0"></iframe>
<br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">
</noscript>
</div>
</div>
{{/if}}
{{{ forms.create_account.recaptcha.markup}}}
<div class="form-actions">
<input type="submit" class="button button--primary" value="{{lang 'forms.create_account.submit_value' }}" />
</div>
Expand Down