Clean up oauth info bar on login page.

This commit is contained in:
Logan Hanks
2012-09-27 10:53:02 -07:00
parent 22b49edc3c
commit 818cc8982b
4 changed files with 26 additions and 8 deletions

View File

@@ -818,7 +818,11 @@ class LoginPage(BoringPage):
if u.path == '/api/v1/authorize':
client_id = u.query_dict.get("client_id")
self.client = client_id and OAuth2Client.get_token(client_id)
self.infobar = self.client and ClientInfoBar(self.client, strings.oauth_login_msg)
if self.client:
self.infobar = ClientInfoBar(self.client,
strings.oauth_login_msg)
else:
self.infobar = None
def content(self):
kw = {}

View File

@@ -76,7 +76,8 @@ string_dict = dict(
cover_msg = _("you'll need to login or register to do that"),
cover_disclaim = _("(don't worry, it only takes a few seconds)"),
oauth_login_msg = _("Log in or register to connect your reddit account with [%(app_name)s](%(app_about_url)s)."),
oauth_login_msg = _(
"Log in or register to connect your reddit account with %(app)s."),
login_fallback_msg = _("try using our secure login form."),

View File

@@ -5487,13 +5487,13 @@ tr.gold-accent + tr > td {
height: 48px;
}
.infobar.client-info .md {
.infobar.client-info div {
line-height: 48px;
margin-left: 56px;
}
.infobar.client-info .md p {
margin: 0;
.infobar.client-info div p {
white-space: nowrap;
}
.oauth2-authorize {

View File

@@ -21,11 +21,24 @@
###############################################################################
<%!
from r2.lib.template_helpers import s3_https_if_secure
from r2.lib.filters import safemarkdown
from r2.lib.template_helpers import s3_https_if_secure, static
%>
<%namespace file="utils.html" import="img_link"/>
<%
icon_url = thing.client.icon_url or static('defaultapp.png')
if thing.client.about_url:
app = '&#32;<a href="%s">%s</a>' % (thing.client.about_url,
websafe(thing.client.name))
else:
app = '&#32;<b>%s</b>' % websafe(thing.client.name)
%>
<div class="infobar ${thing.extra_class}">
${img_link(thing.client.name, s3_https_if_secure(thing.client.icon_url), thing.client.about_url, _class="icon")}
${unsafe(safemarkdown(thing.message % dict(app_name=thing.client.name, app_about_url=thing.client.about_url)))}
${img_link(thing.client.name, s3_https_if_secure(icon_url),
thing.client.about_url, _class="icon")}
<div>
<p>
${unsafe(thing.message % dict(app=app))}
</p>
</div>
</div>