Refactor user login, change password to use colander/deform
This commit is contained in:
parent
cff757fe9e
commit
ec438ead51
5 changed files with 53 additions and 69 deletions
|
@ -1,17 +1,8 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">Change Password</%def>
|
||||
|
||||
<div class="form">
|
||||
${h.form(url('change_password'))}
|
||||
${form.csrf_token()}
|
||||
${form.referrer_field()}
|
||||
${form.field_div('current_password', form.password('current_password'))}
|
||||
${form.field_div('new_password', form.password('new_password'))}
|
||||
${form.field_div('confirm_password', form.password('confirm_password'))}
|
||||
<div class="buttons">
|
||||
${h.submit('submit', "Change Password")}
|
||||
</div>
|
||||
${h.end_form()}
|
||||
${form.render_deform()|n}
|
||||
</div>
|
||||
|
|
|
@ -76,6 +76,9 @@ ${h.csrf_token(request)}
|
|||
## % if form.creating and form.allow_successive_creates:
|
||||
## ${h.submit('create_and_continue', form.successive_create_label)}
|
||||
## % endif
|
||||
% if getattr(form, 'show_reset', False):
|
||||
<input type="reset" value="Reset" />
|
||||
% endif
|
||||
% if getattr(form, 'show_cancel', True):
|
||||
${h.link_to("Cancel", form.cancel_url, class_='cancel button{}'.format(' autodisable' if form.auto_disable_cancel else ''))}
|
||||
% endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">Login</%def>
|
||||
|
@ -19,19 +19,7 @@
|
|||
|
||||
<%def name="login_form()">
|
||||
<div class="form">
|
||||
${form.begin(**{'data-ajax': 'false'})}
|
||||
${form.hidden('referrer', value=referrer)}
|
||||
${form.csrf_token()}
|
||||
|
||||
${form.field_div('username', form.text('username'))}
|
||||
${form.field_div('password', form.password('password'))}
|
||||
|
||||
<div class="buttons">
|
||||
${form.submit('submit', "Login")}
|
||||
<input type="reset" value="Reset" />
|
||||
</div>
|
||||
|
||||
${form.end()}
|
||||
${form.render_deform(form_kwargs={'data-ajax': 'false'})|n}
|
||||
</div>
|
||||
</%def>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue