#NEWLINE# @ presentation . render_for ( PasswordResetForm ) #NEWLINE# def render_password_reset_form( self , h , comp , * args ) : #NEWLINE# #INDENT# application_url = h . request . application_url #NEWLINE# def commit( ) : #NEWLINE# #INDENT# user = self . commit ( ) #NEWLINE# if user : #NEWLINE# #INDENT# comp . answer ( ( user . username , application_url ) ) #NEWLINE# #UNINDENT# #UNINDENT# ( h << self . header . render ( h , 'hide' ) ) #NEWLINE# with h . div ( class_ = 'regForm' ) : #NEWLINE# #INDENT# with h . p : #NEWLINE# #INDENT# ( h << _ ( "Please enter your username and your email address and you'll receive an email that contains a link to reset your password." ) ) #NEWLINE# #UNINDENT# with h . form . post_action ( self . validate_email_match_user_email ) : #NEWLINE# #INDENT# with h . div ( class_ = 'fields' ) : #NEWLINE# #INDENT# fields = ( ( _ ( 'Username' ) , 'username' , 'text' , self . username ) , ( _ ( 'Email address' ) , 'email' , 'text' , self . email ) ) #NEWLINE# for ( label , css_class , input_type , property ) in fields : #NEWLINE# #INDENT# with h . div ( class_ = ( '%s-field field' % css_class ) ) : #NEWLINE# #INDENT# id = h . generate_id ( 'field' ) #NEWLINE# with h . label ( for_ = id ) : #NEWLINE# #INDENT# ( h << label ) #NEWLINE# #UNINDENT# ( h << h . input ( id = id , type = input_type , value = property ( ) ) . action ( property ) . error ( property . error ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# with h . div ( class_ = 'actions' ) : #NEWLINE# #INDENT# ( h << h . input ( type = 'submit' , value = _ ( 'Reset password' ) , class_ = 'btn btn-primary' ) . action ( commit ) ) #NEWLINE# #UNINDENT# ( h << ( _ ( 'Remember your password?' ) , ' ' , h . a ( _ ( 'Log in' ) ) . action ( comp . answer , ( None , None ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return h . root