mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 07:48:16 -05:00
Show user flair on .mobile
This commit is contained in:
committed by
Logan Hanks
parent
e9c50e59b3
commit
447ef411c4
@@ -147,3 +147,4 @@ ul {
|
||||
.md img { display: none }
|
||||
.md ol, .md ul { margin: 10px 2em; }
|
||||
.md pre { margin: 10px; }
|
||||
.flair { color: #545454; background-color: #F5F5F5; border: 1px solid #DEDEDE; }
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<%!
|
||||
from pylons.i18n import _, ungettext
|
||||
from r2.lib.filters import safemarkdown
|
||||
from r2.lib.pages import WrappedUser
|
||||
%>
|
||||
<%inherit file="printable.mobile" />
|
||||
|
||||
@@ -47,8 +48,22 @@
|
||||
%else:
|
||||
|
||||
<p class="byline">
|
||||
<%
|
||||
author = thing.author
|
||||
if WrappedUser(author).has_flair and WrappedUser(author).flair_enabled:
|
||||
flair = WrappedUser(author).flair_text
|
||||
flair_left = WrappedUser(author).flair_position == 'left'
|
||||
else:
|
||||
flair = False
|
||||
%>
|
||||
%if flair and flair_left:
|
||||
<span class="flair">${flair}</span>
|
||||
%endif
|
||||
<a href="/user/${thing.author.name}">
|
||||
<b>${thing.author.name}</b></a>
|
||||
%if flair and not flair_left:
|
||||
<span class="flair">${flair}</span>
|
||||
%endif
|
||||
|<span class="score">${thing.score} ${ungettext("point", "points", thing.score)} </span>
|
||||
${_("written")} ${thing.timesince} ${_("ago")}
|
||||
</p>
|
||||
|
||||
@@ -59,8 +59,19 @@
|
||||
name = websafe(author.name)
|
||||
href = unsafe('href="/user/%s.mobile"' % name)
|
||||
if c.user_is_admin: name += " (%d)" % (author.link_karma)
|
||||
if WrappedUser(author).has_flair and WrappedUser(author).flair_enabled:
|
||||
flair = WrappedUser(author).flair_text
|
||||
flair_left = WrappedUser(author).flair_position == 'left'
|
||||
else:
|
||||
flair = False
|
||||
%>
|
||||
%if flair and flair_left:
|
||||
<span class="flair">${flair}</span>
|
||||
%endif
|
||||
<a class="${author_cls}" ${href}>${name}</a>
|
||||
%if flair and not flair_left:
|
||||
<span class="flair">${flair}</span>
|
||||
%endif
|
||||
%endif
|
||||
</%def>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user