Skip to content

Commit

Permalink
Display current username prominently on OAuth authorization page.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjoconnor committed Mar 2, 2016
1 parent 532de44 commit d30cfba
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions r2/r2/templates/oauth2authorization.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<%!
import datetime
from r2.models import OAuth2AccessToken
from r2.lib.template_helpers import static, make_url_protocol_relative, _wsf, format_html
from r2.lib.template_helpers import static, make_url_protocol_relative, _wsf, format_html, add_sr
%>
<%namespace file="clientinfobar.html" import="app_link" />
<%namespace file="prefapps.html" import="scope_details" />
Expand All @@ -42,8 +42,18 @@
&nbsp;
</div>
<h1>
${_wsf("%(app)s requests to connect with your reddit account.",
app=unsafe(app_link(thing.client)))}
<%
username_link = format_html(
'<a href="%(user_url)s">%(username)s</a>',
username=c.user.name,
user_url=add_sr("/user/%s" % c.user.name, sr_path=False),
)
%>
${_wsf(
"Hey %(username)s! %(app)s would like to connect with your reddit account.",
app=unsafe(app_link(thing.client)),
username=username_link,
)}
</h1>
<div class="access">
<div class="access-permissions">
Expand Down

0 comments on commit d30cfba

Please sign in to comment.