add nsfw tags

This commit is contained in:
teddit 2020-12-23 15:52:51 +01:00
parent b014c950ef
commit 836438dfeb
7 changed files with 29 additions and 6 deletions

19
dist/css/styles.css vendored
View File

@ -377,6 +377,18 @@ header .tabmenu li.active a {
.green {
color: green !important;
}
.tag {
display: inline-block;
border: 1px solid;
padding: 0 4px;
margin: 2px 6px 0px 0px;
border-radius: 3px;
font-size: 0.68rem;
}
.tag.nsfw {
border-color: #d10023;
color: #d10023;
}
input[type="submit"],
.btn {
padding: 3px;
@ -514,12 +526,12 @@ input[type="submit"]:hover,
text-decoration: none;
padding-left: 5px;
}
#links .link .entry .meta p.comments {
#links .link .entry .meta .links {
float: left;
width: 100%;
margin-top: 1px;
}
#links .link .entry .meta p.comments a {
#links .link .entry .meta .links a {
padding: 0;
color: #888;
font-weight: bold;
@ -537,7 +549,6 @@ input[type="submit"]:hover,
#links.search .link .meta a.comments {
margin-left: 0px;
}
/* COMMENTS */
.comment {
font-size: 0.83rem;
@ -987,12 +998,10 @@ input[type="submit"]:hover,
font-weight: bold;
}
#user .entries .entry .title .meta a.comments {
float: left;
margin-left: 0px;
}
#user .entries .entry a.comments.t1,#user .entries .entry a.context {
margin-top: 0px;
float: left;
}
#user .entries .entry a.context {
margin-right: 10px;

View File

@ -21,6 +21,7 @@ module.exports = function(fetch) {
link_flair_text: post.link_flair_text,
name: post_id,
num_comments: post.num_comments,
over_18: post.over_18,
permalink: teddifyUrl(post.permalink),
title: post.title,
url: teddifyUrl(post.url),
@ -81,6 +82,7 @@ module.exports = function(fetch) {
title: post.crosspost.title,
name: post.crosspost.name,
num_comments: post.crosspost.num_comments,
over_18: post.crosspost.over_18,
id: post.crosspost.id,
permalink: teddifyUrl(post.crosspost.permalink),
ups: post.crosspost.ups,

View File

@ -64,6 +64,7 @@ module.exports = function() {
locked: data.locked,
media: data.media,
num_comments: data.num_comments,
over_18: data.over_18,
permalink: data.permalink,
score: data.score,
subreddit: data.subreddit,

View File

@ -62,6 +62,7 @@ module.exports = function() {
edited: post.edited,
selftext_html: unescape(post.selftext_html),
num_comments: post.num_comments,
over_18: post.over_18,
permalink: post.permalink,
user_flair: await formatUserFlair(post)
}
@ -78,6 +79,7 @@ module.exports = function() {
edited: post.edited,
body_html: unescape(post.body_html),
num_comments: post.num_comments,
over_18: post.over_18,
permalink: post.permalink,
link_author: post.link_author,
link_title: post.link_title,

View File

@ -33,6 +33,9 @@ html
a(href="/u/" + post.author + "")
| #{post.author}
!= post.user_flair
.links
if post.over_18
span.tag.nsfw NSFW
if post.crosspost.is_crosspost === true
.crosspost
.title

View File

@ -105,7 +105,9 @@ html
| #{link.subreddit}
if link.stickied
span(class="green") stickied
p.comments
.links
if link.over_18
span.tag.nsfw NSFW
a(href="" + link.permalink + "", class="comments")
| #{link.num_comments} comments
if json.info.before || json.info.after

View File

@ -86,6 +86,8 @@ html
| to
!= post.user_flair
a(href="/r/" + post.subreddit + "", class="subreddit") #{post.subreddit}
if post.over_18
span.tag.nsfw NSFW
a.comments(href="" + post.permalink + "") #{post.num_comments} comments
if post.type === 't1'
.entry
@ -116,6 +118,8 @@ html
p.created(title="" + toUTCString(post.created) + "") #{timeDifference(post.created)}
.body
div !{post.body_html}
if post.over_18
span.tag.nsfw NSFW
a.context(href="" + post.permalink + "?context=10") context
a.comments.t1(href="" + post.url + "") full comments (#{post.num_comments})
if data.before || data.after