diff options
author | Akshay <[email protected]> | 2024-12-05 21:12:59 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2024-12-05 21:12:59 +0000 |
commit | 8dba8a8375ac69b2547a31c9db41a71964ed186c (patch) | |
tree | 5ac4e5790c829ae9fb244305290edc19795656ed /src | |
parent | d214040c0b4a7dcd7dd386e0169b77a1c74de489 (diff) |
add urls to open comments and submissions externally
Diffstat (limited to 'src')
-rw-r--r-- | src/mixins/comment.pug | 29 | ||||
-rw-r--r-- | src/public/styles.css | 4 | ||||
-rw-r--r-- | src/views/comments.pug | 6 |
3 files changed, 26 insertions, 13 deletions
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 | |||
2 | 2 | ||
3 | mixin infoContainer(data, next_id, prev_id) | 3 | mixin infoContainer(data, next_id, prev_id) |
4 | div.comment-info-container | 4 | div.comment-info-container |
5 | | #{fmtnum(data.ups)} ↑ | 5 | p |
6 | | · | 6 | | #{fmtnum(data.ups)} ↑ |
7 | if next_id | 7 | | · |
8 | a(href=`#${next_id}`).nav-link next | 8 | if next_id |
9 | a(href=`#${next_id}` title="scroll to next comment").nav-link next | ||
10 | | · | ||
11 | if prev_id | ||
12 | a(href=`#${prev_id}` title="scroll to previous comment").nav-link prev | ||
13 | | · | ||
14 | span(class=`${data.is_submitter ? 'op' : ''}`) | ||
15 | | u/#{data.author} #{data.is_submitter ? '(op)' : ''} | ||
9 | | · | 16 | | · |
10 | if prev_id | 17 | if data.collapsed_reason_code == "DELETED" |
11 | a(href=`#${prev_id}`).nav-link prev | 18 | a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete |
19 | | · | ||
20 | | #{timeDifference(Date.now(), data.created * 1000)} | ||
12 | | · | 21 | | · |
13 | span(class=`${data.is_submitter ? 'op' : ''}`) | 22 | a(href=`https://reddit.com${data.permalink}` title="view on reddit").nav-link open ↗ |
14 | | u/#{data.author} #{data.is_submitter ? '(op)' : ''} | ||
15 | | · | ||
16 | if data.collapsed_reason_code == "DELETED" | ||
17 | a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete | ||
18 | | · | ||
19 | | #{timeDifference(Date.now(), data.created * 1000)} | ||
20 | 23 | ||
21 | - | 24 | - |
22 | function hasReplies(data) { | 25 | 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 { | |||
579 | a.nav-link { | 579 | a.nav-link { |
580 | color: var(--text-color-muted); | 580 | color: var(--text-color-muted); |
581 | } | 581 | } |
582 | |||
583 | .comment-info-container > p { | ||
584 | margin-top: 0px; | ||
585 | } | ||
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 | |||
25 | a(href=`/r/${post.subreddit}`) ← r/#{post.subreddit} | 25 | a(href=`/r/${post.subreddit}`) ← r/#{post.subreddit} |
26 | 26 | ||
27 | div.info-container | 27 | div.info-container |
28 | - var domain = (new URL(post.url)).hostname | ||
28 | p | 29 | p |
29 | | #{fmtnum(post.ups)} ↑ | 30 | | #{fmtnum(post.ups)} ↑ |
30 | | · by u/#{post.author} | 31 | | · by u/#{post.author} |
31 | | · | 32 | | · |
32 | | #{timeDifference(Date.now(), post.created * 1000)} | 33 | | #{timeDifference(Date.now(), post.created * 1000)} |
34 | | · | ||
35 | if domain !== 'www.reddit.com' | ||
36 | a(href=`${post.url}`) submission url ↗ | ||
37 | | · | ||
38 | a(href=`https://reddit.com${post.permalink}`) reddit ↗ | ||
33 | 39 | ||
34 | h2.post-title | 40 | h2.post-title |
35 | != post.title | 41 | != post.title |