diff --git a/inc/processJsonPost.js b/inc/processJsonPost.js index ad0fb8f..38d1056 100644 --- a/inc/processJsonPost.js +++ b/inc/processJsonPost.js @@ -28,6 +28,7 @@ module.exports = function(fetch) { ups: post.ups, id: post.id, domain: post.domain, + contest_mode: post.contest_mode, comments: null, has_media: false, media: null, diff --git a/routes.js b/routes.js index eb392e4..4c6a6d1 100644 --- a/routes.js +++ b/routes.js @@ -474,7 +474,7 @@ module.exports = (app, redis, fetch, RedditAPI) => { sortby = config.post_comments_sort } - if(!['confidence', 'top', 'new', 'controversial', 'old', 'qa'].includes(sortby)) { + if(!['confidence', 'top', 'new', 'controversial', 'old', 'qa', 'random'].includes(sortby)) { console.error(`Got invalid sort.`, req.originalUrl) return res.redirect('/') } diff --git a/static/css/styles.css b/static/css/styles.css index 365fcb4..60db2c3 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -70,6 +70,10 @@ body.dark #post .infobar { background-color: #d2d2d2; color: #2f2f2f; } +body.dark #post .infobar.blue { + background: #c7e3f9; + border: 1px solid #4b78a4; +} body.dark #post .infobar a { color: #0356d4; } @@ -660,6 +664,10 @@ input[type="submit"]:hover, float: left; width: calc(100% - 50px); } +#post .infobar.blue { + background: #eff8ff; + border: 1px solid #93abc2; +} #post header { padding-top: 0px; } diff --git a/views/post.pug b/views/post.pug index 591e4dc..602a904 100644 --- a/views/post.pug +++ b/views/post.pug @@ -134,6 +134,9 @@ html a(href="" + post.media.source + "") [media] if post.selftext div.usertext-body !{post.selftext} + if post.contest_mode + .infobar.blue + p this thread is in contest mode - contest mode randomizes comment sorting and hides scores. if viewing_comment .infobar p you are viewing a single comment's thread.