diff --git a/dist/css/styles.css b/dist/css/styles.css index 8c4c4c7..1aa24ca 100644 --- a/dist/css/styles.css +++ b/dist/css/styles.css @@ -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; diff --git a/inc/processJsonPost.js b/inc/processJsonPost.js index 467009f..b9f7e24 100644 --- a/inc/processJsonPost.js +++ b/inc/processJsonPost.js @@ -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, diff --git a/inc/processJsonSubreddit.js b/inc/processJsonSubreddit.js index 1b4c04c..a108dd7 100644 --- a/inc/processJsonSubreddit.js +++ b/inc/processJsonSubreddit.js @@ -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, diff --git a/inc/processJsonUser.js b/inc/processJsonUser.js index fe86322..f0c0687 100644 --- a/inc/processJsonUser.js +++ b/inc/processJsonUser.js @@ -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, diff --git a/views/post.pug b/views/post.pug index 861c8ce..591e4dc 100644 --- a/views/post.pug +++ b/views/post.pug @@ -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 diff --git a/views/subreddit.pug b/views/subreddit.pug index bbf90a0..aaf9905 100644 --- a/views/subreddit.pug +++ b/views/subreddit.pug @@ -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 diff --git a/views/user.pug b/views/user.pug index d1766b3..3938cc4 100644 --- a/views/user.pug +++ b/views/user.pug @@ -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