Commit 8fb60a28 authored by peterh-gr's avatar peterh-gr
Browse files

Added captcha and error handling to newsletter form

There are some errors that can happen when submitting the subscription
request and we don't want to have any styled pages on the donate site
once we finish moving the donate pages to lektor, so we need to have the
donate site redirect with error messages back to the original page, then
use Javascript to get the errors displayed.

Issue #48283
parent 868becff
lego @ 925c4c17
Subproject commit 7f2289bf68685da40878bb09ee91346057c443d3 Subproject commit 925c4c1761ca69c4367f79b15ed9a2bc19a19a33
...@@ -30,16 +30,32 @@ ...@@ -30,16 +30,32 @@
<div class="row mb-1"> <div class="row mb-1">
<div class="col-12"> <div class="col-12">
<div class="row mt-4 mb-2"> <div class="row mt-4 mb-2">
<form action="" method="POST" class="form-wide"> <form action="https://tor-donate.local/subscription-request" method="POST" class="form-wide">
<input type="hidden" name="returnToReferrer" value="1" />
<div class="form-group row"> <div class="form-group row">
<div class="col-sm-10"> <div class="col-sm-12 errors">
<div class="form-group row">
<div class="col-sm-12">
<input class="form-control form-control-lg form-required" id="email" <input class="form-control form-control-lg form-required" id="email"
name="email" placeholder="* Email Address" value="" type="email" /> name="email" placeholder="* Email Address" value="" type="email" />
</div> </div>
<div class="form-group row">
<div class="col-sm-6 captcha">
<input id="captcha" type="text" class="form-control form-control-lg form-required" data-name="captcha" data-stripe="captcha" aria-label="captcha" name="captcha" size="4" placeholder="* Enter the 4 letters (case insenstive) that appear below">
<img src="https://tor-donate.local/captcha" border="0" />
<div class="form-group row">
<div class="col-sm-12">
<input class="donate btn btn-lg btn-success btn-block col-2" value="Join" type="submit" /> <input class="donate btn btn-lg btn-success btn-block col-2" value="Join" type="submit" />
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<script src="{{ '/static/js/errors.js'|asseturl }}" ></script>
{% endblock %} {% endblock %}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ '/static/style.css'|asseturl }}"> <link rel="stylesheet" href="{{ '/static/style.css'|asseturl }}">
<script src="{{ '/static/js/errors.js'|asseturl }}"></script>
<title>{% block title %}{{ this.title }}{% endblock %}</title> <title>{% block title %}{{ this.title }}{% endblock %}</title>
<body> <body>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment