Add NSFW and Quarantined stamps to comments on profile pages.

This commit is contained in:
Matt Lee
2015-07-24 16:52:38 -07:00
committed by Florence Yeun
parent 9084cff6f9
commit 1cdf540a94
3 changed files with 23 additions and 2 deletions

View File

@@ -1378,6 +1378,8 @@ class Comment(Thing, Printable):
extra_css += " border"
if profilepage:
item.nsfw = user.pref_label_nsfw and (item.link.is_nsfw or item.subreddit.over_18)
link_author = authors[item.link.author_id]
if ((item.link._deleted or link_author._deleted) and
not user_is_admin):

View File

@@ -871,7 +871,13 @@ body > .content .link.compressed .midcol {
a.author { margin-right: 0.5em; }
a.banned-user { color: red; }
.thing .parent .author { margin-right: 0.5em; }
.thing .parent {
.stamp,
.author {
margin-right: 0.5em;
}
}
.flair, .linkflairlabel {
display: inline-block;
@@ -4506,10 +4512,12 @@ form input[type=radio] {margin: 2px .5em 0 0; }
@color-archived-stamp: lighten(@color-text-grey, 15%);
.stamp {
display: inline-block;
font-size: x-small;
padding: 0 2px;
border: none;
border-radius: 3px;
line-height: 1.6em;
}
.nsfw-stamp {

View File

@@ -26,7 +26,7 @@
from r2.lib.pages import WrappedUser
%>
<%namespace file="utils.html" import="plain_link, thing_timestamp, edited" />
<%namespace file="utils.html" import="plain_link, thing_timestamp, edited, nsfw_stamp, quarantine_stamp" />
<%inherit file="comment_skeleton.html"/>
#####################
@@ -145,6 +145,17 @@ ${parent.midcol(cls = cls)}
</%def>
<%def name="buttons()">
%if c.profilepage:
%if thing.subreddit.quarantine:
<li class="rounded quarantine-stamp stamp">
${quarantine_stamp()}
</li>
%elif thing.nsfw:
<li class="rounded nsfw-stamp stamp">
${nsfw_stamp()}
</li>
%endif
%endif
${CommentButtons(thing)}
${self.admintagline()}
</%def>