Skip to content

Commit f040ff7

Browse files
authored
Merge pull request #230 from dpc-sdp/SXDEDPCXZIC-333
SXDEDPCXZIC-333_DATAVIC-717 / recaptcha implementation
2 parents 937434b + 629bd65 commit f040ff7

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% ckan_extends %}
2+
3+
4+
{% block form %}
5+
<form action="" method="post">
6+
{{ h.csrf_input() }}
7+
<div class="form-group">
8+
<label for="field-username">{{ _('Email or username') }}</label>
9+
<input id="field-username" class="control-medium form-control" name="user" value="" type="text" />
10+
</div>
11+
12+
{% if g.recaptcha_publickey %}
13+
{% snippet "user/snippets/recaptcha.html", public_key=g.recaptcha_publickey %}
14+
{% endif %}
15+
16+
<div class="form-actions">
17+
{% block form_button %}
18+
<button class="btn btn-primary" type="submit" name="reset">{{ _("Request Reset") }}</button>
19+
{% endblock %}
20+
</div>
21+
</form>
22+
{% endblock %}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% import 'macros/form.html' as form %}
2+
3+
{% set username_error = true if error_summary %}
4+
{% set password_error = true if error_summary %}
5+
6+
<form action="{{ action }}" method="post">
7+
{{ h.csrf_input() }}
8+
{{ form.errors(errors=error_summary) }}
9+
10+
{{ form.input('login', label=_("Username or Email"), id='field-login', value="", error=username_error, classes=["control-medium"]) }}
11+
12+
{{ form.input('password', label=_("Password"), id='field-password', type="password", value="", error=password_error, classes=["control-medium"]) }}
13+
14+
{{ form.checkbox('remember', label=_("Remember me"), id='field-remember', checked=true, value="63072000") }}
15+
16+
{% if g.recaptcha_publickey %}
17+
{% snippet "user/snippets/recaptcha.html", public_key=g.recaptcha_publickey %}
18+
{% endif %}
19+
20+
<div class="form-actions">
21+
{% block login_button %}
22+
<button class="btn btn-primary" type="submit">{{ _('Login') }}</button>
23+
{% endblock %}
24+
</div>
25+
</form>

0 commit comments

Comments
 (0)