ReCaptcha

Torey Heinz committed Dec 11, 2018
commit 8fb42918ac5ec15c472781f3a729fbbbd69c85a4
Showing 4 changed files with 17 additions and 7 deletions
app/content_types/project_requests.yml +10 -6
@@ @@ -37,6 +37,9 @@ display_settings:
# A list describing each field
fields:
+ - captcha:
+ required: true
+ type: string
- name: # The lowercase, underscored name of the field
label: Name # Human readable name of the field
type: string
@@ @@ -96,24 +99,25 @@ fields:
label: Boat Name
type: string
- - location: # The lowercase, underscored name of the field
- label: Current Location # Human readable name of the field
- type: string
- required: false
- localized: false
- marina_name:
label: Marina Name
type: string
- slip_number:
- label: Slip Number
+ label: Dock/Slip Number
type: string
- building_number:
label: Building Number
type: string
+ - location: # The lowercase, underscored name of the field
+ label: Location Details # Human readable name of the field
+ type: string
+ required: false
+ localized: false
+
- completion_date: # The lowercase, underscored name of the field
label: Requested Completion Date # Human readable name of the field
type: string
app/views/pages/contact.liquid +3 -0
@@ @@ -52,6 +52,7 @@ editable_elements:
{% endfor %}
</ul>
{% endif %}
+ <input id="captcha" name="content[captcha]" type="hidden">
<label>
Full Name:
<input name="content[name]" required="true" type="text" value="{{customer_message.name}}">
@@ @@ -120,6 +121,8 @@ editable_elements:
if (grecaptcha.getResponse() == "") {
e.preventDefault();
$('.robot-warning').removeClass('hide')
+ } else if (grecaptcha.getResponse().length > 250) {
+ $('input#captcha')[0].val(grecaptcha.getResponse())
}
});
});
app/views/pages/estimate.liquid +2 -0
@@ @@ -45,6 +45,8 @@ editable_elements:
if (grecaptcha.getResponse() == "") {
e.preventDefault();
$('.robot-warning').removeClass('hide')
+ } else if (grecaptcha.getResponse().length > 250) {
+ $('input#captcha')[0].val(grecaptcha.getResponse())
}
});
});
app/views/snippets/estimate_form.liquid +2 -1
@@ @@ -7,6 +7,7 @@
{% endfor %}
</ul>
{% endif %}
+ <input id="captcha" name="content[captcha]" type="hidden">
<label>
<strong>Full Name:</strong>{% include 'required' %}
<input name="content[name]" required type="text" value="{{project_request.name}}">
@@ @@ -97,7 +98,7 @@
</div>
<div class="column small-3">
<label>
- Slip#
+ Dock/Slip#
<input name="content[slip_number]" required type="text" value="{{project_request.slip_number}}">
</label>
</div>