Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
forgotpwd
Commits
f61562fcf20e
Commit
9ac21f07
authored
Jan 21, 2010
by
Charles Hebert
Browse files
Remove duplicated code for login popup
parent
5f7a18e12fea
Changes
1
Hide whitespace changes
Inline
Side-by-side
views.py
View file @
f61562fc
...
...
@@ -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> </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
# -------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment