Use view class for popup login form.

This commit is contained in:
Max Goodman
2013-04-25 02:49:59 -07:00
parent 4b53396821
commit 3fdfabd408
3 changed files with 6 additions and 6 deletions

View File

@@ -938,9 +938,10 @@ class PasswordVerificationForm(Templated):
class Login(Templated):
"""The two-unit login and register form."""
def __init__(self, user_reg = '', user_login = '', dest=''):
def __init__(self, user_reg = '', user_login = '', dest='', is_popup=False):
Templated.__init__(self, user_reg = user_reg, user_login = user_login,
dest = dest, captcha = Captcha())
dest = dest, captcha = Captcha(),
is_popup=is_popup)
class Register(Login):
pass

View File

@@ -36,7 +36,7 @@
${login_panel(login_form,
user_reg = thing.user_reg, user_login = thing.user_login,
dest=thing.dest)}
%if not g.disable_captcha:
%if not thing.is_popup and not g.disable_captcha:
<script type="text/javascript">
$.request("new_captcha");
</script>

View File

@@ -23,13 +23,12 @@
<%!
from r2.lib.template_helpers import add_sr, static, join_urls, class_dict, get_domain
from r2.lib.filters import unsafe
from r2.lib.pages import SearchForm, ClickGadget, SideContentBox
from r2.lib.pages import SearchForm, ClickGadget, SideContentBox, Login
from r2.lib import tracking
from pylons import request
from r2.lib.strings import strings
from r2.models import make_feedurl, Sub
%>
<%namespace file="login.html" import="login_panel, login_form"/>
<%namespace file="framebuster.html" import="framebuster"/>
<%namespace file="less.html" import="less_js, less_stylesheet"/>
<%namespace file="utils.html" import="tags, classes"/>
@@ -158,7 +157,7 @@
${_("close this window")}
</a>
<h1 class="cover-msg">${strings.cover_msg}</h1>
${login_panel(login_form)}
${Login(is_popup=True)}
</div>
</div>
%endif