diff options
Diffstat (limited to 'src/mixins')
-rw-r--r-- | src/mixins/comment.pug | 4 | ||||
-rw-r--r-- | src/mixins/header.pug | 9 | ||||
-rw-r--r-- | src/mixins/post.pug | 24 |
3 files changed, 27 insertions, 10 deletions
diff --git a/src/mixins/comment.pug b/src/mixins/comment.pug index 545ee59..8d341c9 100644 --- a/src/mixins/comment.pug +++ b/src/mixins/comment.pug | |||
@@ -8,8 +8,8 @@ mixin comment(com, isfirst) | |||
8 | else | 8 | else |
9 | div(class=`comment ${isfirst?'first':''}`) | 9 | div(class=`comment ${isfirst?'first':''}`) |
10 | div.comment-info-container | 10 | div.comment-info-container |
11 | div.info-item u/#{data.author} | 11 | div.info-item #{fmtnum(data.ups)} ↑ |
12 | div.info-item ↑ #{fmtnum(data.ups)} | 12 | div.info-item u/#{data.author} #{data.is_submitter?'(OP)':''} |
13 | if data.collapsed_reason_code == "DELETED" | 13 | if data.collapsed_reason_code == "DELETED" |
14 | div.info-item | 14 | div.info-item |
15 | a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete | 15 | a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete |
diff --git a/src/mixins/header.pug b/src/mixins/header.pug new file mode 100644 index 0000000..e3b3870 --- /dev/null +++ b/src/mixins/header.pug | |||
@@ -0,0 +1,9 @@ | |||
1 | mixin header() | ||
2 | div.header | ||
3 | div.header-item | ||
4 | a(href=`/`) home | ||
5 | div.header-item | ||
6 | a(href=`/subs`) subscriptions | ||
7 | div.header-item | ||
8 | a(href=`/r/popular`) popular | ||
9 | |||
diff --git a/src/mixins/post.pug b/src/mixins/post.pug index 8a66d53..20ec7c8 100644 --- a/src/mixins/post.pug +++ b/src/mixins/post.pug | |||
@@ -9,9 +9,9 @@ mixin post(p) | |||
9 | span.domain (#{p.domain}) | 9 | span.domain (#{p.domain}) |
10 | div.info-container | 10 | div.info-container |
11 | p | 11 | p |
12 | | ↑ #{fmtnum(p.ups)} | 12 | | #{fmtnum(p.ups)} ↑ |
13 | | · | 13 | | · |
14 | a(href=`/comments/${p.id}`) #{fmtnum (p.num_comments)} replies | 14 | a(href=`/comments/${p.id}`) #{fmtnum (p.num_comments)} ↩ |
15 | | · | 15 | | · |
16 | a(href=`/r/${p.subreddit}`) r/#{p.subreddit} | 16 | a(href=`/r/${p.subreddit}`) r/#{p.subreddit} |
17 | span.post-author | 17 | span.post-author |
@@ -36,12 +36,14 @@ mixin post(p) | |||
36 | if p.gallery_data.items | 36 | if p.gallery_data.items |
37 | details(id=`${p.id}`) | 37 | details(id=`${p.id}`) |
38 | summary expand gallery | 38 | summary expand gallery |
39 | each item in p.gallery_data.items | 39 | div.gallery |
40 | - var url = `https://i.redd.it/${item.media_id}.jpg` | 40 | each item in p.gallery_data.items |
41 | a(href=`/media/${url}`) | 41 | - var url = `https://i.redd.it/${item.media_id}.jpg` |
42 | img(src=url).post-media | 42 | div.gallery-item |
43 | a(href=`/media/${url}`) | ||
44 | img(src=url) | ||
43 | button(onclick=`toggleDetails('${p.id}')`) close | 45 | button(onclick=`toggleDetails('${p.id}')`) close |
44 | if (p.post_hint == "image" || p.post_hint == "link") && p.thumbnail && p.thumbnail != "self" && p.thumbnail != "default" | 46 | if p.post_hint == "image" && p.thumbnail && p.thumbnail != "self" && p.thumbnail != "default" |
45 | details(id=`${p.id}`) | 47 | details(id=`${p.id}`) |
46 | summary expand image | 48 | summary expand image |
47 | a(href=`/media/${p.url}`) | 49 | a(href=`/media/${p.url}`) |
@@ -53,4 +55,10 @@ mixin post(p) | |||
53 | - var url = p.secure_media.reddit_video.dash_url | 55 | - var url = p.secure_media.reddit_video.dash_url |
54 | video(src=url controls data-dashjs-player).post-media | 56 | video(src=url controls data-dashjs-player).post-media |
55 | button(onclick=`toggleDetails('${p.id}')`) close | 57 | button(onclick=`toggleDetails('${p.id}')`) close |
56 | 58 | else if p.post_hint == "link" && p.thumbnail && p.thumbnail != "self" && p.thumbnail != "default" | |
59 | details(id=`${p.id}`) | ||
60 | summary expand link | ||
61 | a(href=`${p.url}`) | ||
62 | | #{p.url} | ||
63 | br | ||
64 | button(onclick=`toggleDetails('${p.id}')`) close | ||