templates: Migrate password reset template to pyramid.

This commit is contained in:
Johannes Bornhold 2016-05-25 11:41:43 +02:00
parent a9f92c92fa
commit 801b79656f

View file

@ -33,22 +33,30 @@
<!-- login -->
<div class="sign-in-title">
<h1>${_('Reset your Password')}</h1>
<h4>${h.link_to(_("Go to the login page to sign in."),h.url('login'))}</h4>
<h4>${h.link_to(_("Go to the login page to sign in."), request.route_path('login'))}</h4>
</div>
<div class="inner form">
${h.form(url('password_reset'), needs_csrf_token=False)}
${h.form(request.route_path('reset_password'), needs_csrf_token=False)}
<label for="email">${_('Email Address')}:</label>
${h.text('email')}
${h.text('email', defaults.get('email'))}
%if 'email' in errors:
<span class="error-message">${errors.get('email')}</span>
<br />
%endif
%if c.captcha_active:
%if captcha_active:
<div class="login-captcha"
<label for="email">${_('Captcha')}:</label>
${h.hidden('recaptcha_field')}
<div id="recaptcha"></div>
%if 'recaptcha_field' in errors:
<span class="error-message">${errors.get('recaptcha_field')}</span>
<br />
%endif
</div>
%endif
${h.submit('send',_('Send password reset email'),class_="btn sign-in")}
${h.submit('send', _('Send password reset email'), class_="btn sign-in")}
<div class="activation_msg">${_('Password reset link will be send to matching email address')}</div>
${h.end_form()}
@ -57,14 +65,14 @@
</div>
</div>
%if c.captcha_active:
%if captcha_active:
<script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>
%endif
<script type="text/javascript">
$(document).ready(function(){
$('#email').focus();
%if c.captcha_active:
Recaptcha.create("${c.captcha_public_key}", "recaptcha", {theme: "white"});
%if captcha_active:
Recaptcha.create("${captcha_public_key}", "recaptcha", {theme: "white"});
%endif
});
</script>
</script>