Commit 9ac21f07 authored by Charles Hebert's avatar Charles Hebert
Browse files

Remove duplicated code for login popup

parent 5f7a18e12fea
......@@ -25,30 +25,11 @@ from logilab.mtconverter import xml_escape
class LogFormTemplateForgotPassword(basetemplates.LogFormTemplate):
def call(self, id, klass, title=False, message=True):
self.req.add_css('cubes.forgotpwd.css')
super(LogFormTemplateForgotPassword, self).call(id, klass, title, message)
def login_form(self, id):
_ = self.req._
self.w(u'<form method="post" action="%s" id="login_form">\n'
% xml_escape(basetemplates.login_form_url(self.config, self.req)))
self.w(u'<table>\n')
self.w(u'<tr>\n')
msg = (self.config['allow-email-login'] and _('login or email')) or _('login')
self.w(u'<td><label for="__login">%s</label></td>' % msg)
self.w(u'<td><input name="__login" id="__login" class="data" type="text" /></td>')
self.w(u'</tr><tr>\n')
self.w(u'<td><label for="__password" >%s</label></td>' % _('password'))
self.w(u'<td><input name="__password" id="__password" class="data" type="password" /></td>\n')
self.w(u'</tr><tr>\n')
self.w(u'<td>&#160;</td><td><input type="submit" class="loginButton right" value="%s" />\n</td>' % _('log in'))
self.w(u'</tr>\n')
self.w(u'</table>\n')
super(LogFormTemplateForgotPassword, self).login_form(id)
self.req.add_css('cubes.forgotpwd.css')
self.w(u'<p style="text-align:center"><a href="%s">%s</a></p>' % (self.build_url('forgottenpassword'),
_('Forgotten your password ?')))
self.w(u'</form>\n')
self.req.html_headers.add_onload('jQuery("#__login:visible").focus()')
self.req._('Forgotten your password ?')))
# First form, send an email
# -------------------------
......
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