[ADD] website_cf_turnstile: add cloudflare turnstile support

This module allows to add secret key to add the turnstile captcha on
each snippet website_form.

Cloudflare Turnstile
--------------------
A friendly, free CAPTCHA replacement
Turnstile delivers frustration-free, CAPTCHA-free web experiences to
website visitors.
Turnstile stops abuse and confirms visitors are real without the data
privacy concerns or awful UX that CAPTCHAs thrust on users.

closes odoo/odoo#119246

X-original-commit: 4aca39a533e9d41f5f452f36a1ffc001f586b4f4
Signed-off-by: Jérémy Kersten <jke@odoo.com>
This commit is contained in:
Jeremy Kersten
2023-04-24 18:25:53 +02:00
parent 761d39658e
commit cb1388ed9e
12 changed files with 240 additions and 1 deletions
@@ -33,6 +33,7 @@ class ResConfigSettings(models.TransientModel):
module_partner_autocomplete = fields.Boolean("Partner Autocomplete")
module_base_geolocalize = fields.Boolean("GeoLocalize")
module_google_recaptcha = fields.Boolean("reCAPTCHA")
module_website_cf_turnstile = fields.Boolean("Cloudflare Turnstile")
report_footer = fields.Html(related="company_id.report_footer", string='Custom Report Footer', help="Footer text displayed at the bottom of all reports.", readonly=False)
group_multi_currency = fields.Boolean(string='Multi-Currencies',
implied_group='base.group_multi_currency',
@@ -176,6 +176,13 @@
<div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up reCaptcha.</div>
</div>
</setting>
<setting help="Protect your forms with CF Turnstile." id="cf-turnstile">
<field name="module_website_cf_turnstile"/>
<div class="content-group" attrs="{'invisible': [('module_website_cf_turnstile', '=', False)]}" id="turnstile_warning">
<div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up Cloudflare turnstile.</div>
</div>
</setting>
</block>
<block title="Performance" groups="base.group_no_one" name="performance">