From 8dba8a8375ac69b2547a31c9db41a71964ed186c Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 5 Dec 2024 21:12:59 +0000 Subject: add urls to open comments and submissions externally --- src/mixins/comment.pug | 29 ++++++++++++++++------------- src/public/styles.css | 4 ++++ src/views/comments.pug | 6 ++++++ 3 files changed, 26 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/mixins/comment.pug b/src/mixins/comment.pug index a7bf9d9..26b5918 100644 --- a/src/mixins/comment.pug +++ b/src/mixins/comment.pug @@ -2,21 +2,24 @@ include ../utils mixin infoContainer(data, next_id, prev_id) div.comment-info-container - | #{fmtnum(data.ups)} ↑ - | ·  - if next_id - a(href=`#${next_id}`).nav-link next + p + | #{fmtnum(data.ups)} ↑ + | ·  + if next_id + a(href=`#${next_id}` title="scroll to next comment").nav-link next + |  ·  + if prev_id + a(href=`#${prev_id}` title="scroll to previous comment").nav-link prev + |  ·  + span(class=`${data.is_submitter ? 'op' : ''}`) + | u/#{data.author} #{data.is_submitter ? '(op)' : ''} |  ·  - if prev_id - a(href=`#${prev_id}`).nav-link prev + if data.collapsed_reason_code == "DELETED" + a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete + |  ·  + | #{timeDifference(Date.now(), data.created * 1000)} |  ·  - span(class=`${data.is_submitter ? 'op' : ''}`) - | u/#{data.author} #{data.is_submitter ? '(op)' : ''} - |  ·  - if data.collapsed_reason_code == "DELETED" - a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete - |  ·  - | #{timeDifference(Date.now(), data.created * 1000)} + a(href=`https://reddit.com${data.permalink}` title="view on reddit").nav-link open ↗ - function hasReplies(data) { diff --git a/src/public/styles.css b/src/public/styles.css index 9bc346f..d401fc7 100644 --- a/src/public/styles.css +++ b/src/public/styles.css @@ -579,3 +579,7 @@ form input[type="submit"]:hover { a.nav-link { color: var(--text-color-muted); } + +.comment-info-container > p { + margin-top: 0px; +} diff --git a/src/views/comments.pug b/src/views/comments.pug index bbd7855..8fde1ce 100644 --- a/src/views/comments.pug +++ b/src/views/comments.pug @@ -25,11 +25,17 @@ html a(href=`/r/${post.subreddit}`) ← r/#{post.subreddit} div.info-container + - var domain = (new URL(post.url)).hostname p | #{fmtnum(post.ups)} ↑ |  ·  by u/#{post.author} |  ·  | #{timeDifference(Date.now(), post.created * 1000)} + |  ·  + if domain !== 'www.reddit.com' + a(href=`${post.url}`) submission url ↗ + |  ·  + a(href=`https://reddit.com${post.permalink}`) reddit ↗ h2.post-title != post.title -- cgit v1.2.3