diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index 7dc5423c2..3781015dc 100755 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -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 = {} diff --git a/r2/r2/lib/strings.py b/r2/r2/lib/strings.py index 520638ef3..24f6cc22d 100644 --- a/r2/r2/lib/strings.py +++ b/r2/r2/lib/strings.py @@ -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."), diff --git a/r2/r2/public/static/css/reddit.css b/r2/r2/public/static/css/reddit.css index ee70a0d20..af68edf64 100755 --- a/r2/r2/public/static/css/reddit.css +++ b/r2/r2/public/static/css/reddit.css @@ -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 { diff --git a/r2/r2/templates/clientinfobar.html b/r2/r2/templates/clientinfobar.html index 006bf774d..cd0e713a6 100644 --- a/r2/r2/templates/clientinfobar.html +++ b/r2/r2/templates/clientinfobar.html @@ -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 = ' %s' % (thing.client.about_url, + websafe(thing.client.name)) + else: + app = ' %s' % websafe(thing.client.name) +%>