teddit/views/post.pug

143 lines
5.8 KiB
Plaintext
Raw Normal View History

2020-11-17 21:44:32 +01:00
doctype html
html
head
2020-12-02 17:02:32 +01:00
title #{cleanTitle(post.title)} : #{subreddit}
2020-11-17 21:44:32 +01:00
include includes/head.pug
2020-11-21 13:50:12 +01:00
body(class=""+ user_preferences.theme +"")
2020-11-17 21:44:32 +01:00
include includes/topbar.pug
if post === null
h1 Error occured
p #{JSON.stringify(error_data)}
else
#post
header
div
2020-12-21 12:27:31 +01:00
p subreddit:
2020-11-17 21:44:32 +01:00
a(href="/r/" + subreddit + "")
p /r/#{subreddit}
.info
.score
div.arrow
span #{kFormatter(post.ups)}
div.arrow.down
.title
a(href="" + post.url + "")
2020-12-02 17:02:32 +01:00
h2 #{cleanTitle(post.title)}
2020-12-13 20:53:32 +01:00
if post.link_flair_text
span(class="postflair") #{post.link_flair_text}
2020-12-04 22:33:40 +01:00
span(class="domain") (#{post.domain})
2020-11-17 21:44:32 +01:00
p.submitted
span(title="" + toUTCString(post.created) + "") submitted #{timeDifference(post.created)} by
if post.author === '[deleted]'
span [deleted]
else
a(href="/u/" + post.author + "")
| #{post.author}
2020-12-21 12:27:31 +01:00
!= post.user_flair
2020-11-17 21:44:32 +01:00
if post.crosspost.is_crosspost === true
.crosspost
.title
a(href="" + post.crosspost.permalink + "")
2020-12-02 17:02:32 +01:00
h2 #{cleanTitle(post.crosspost.title)}
2020-12-04 22:33:40 +01:00
span(class="domain") (#{post.domain})
2020-11-17 21:44:32 +01:00
.num_comments
| #{post.crosspost.num_comments} comments
.score
div.arrow
span #{kFormatter(post.crosspost.ups)}
div.arrow.down
p.submitted
span(title="" + toUTCString(post.crosspost.created) + "") submitted #{timeDifference(post.crosspost.created)} by
if post.crosspost.author === '[deleted]'
span [deleted]
else
a(href="/u/" + post.crosspost.author + "")
| #{post.crosspost.author}
2020-12-21 12:27:31 +01:00
!= post.user_flair
2020-11-17 21:44:32 +01:00
p.to to
a(href="/r/" + post.crosspost.subreddit + "")
| #{post.crosspost.subreddit}
if !post.has_media
if post.images
.image
a(href="" + post.images.source + "")
img(src="" + post.images.source + "", alt="")
else
if post.media.not_hosted_in_reddit
.video
a(href="" + post.media.source + "")
img(src=""+ post.media.source +"")
p Embed URL:
a(href="" + post.media.embed_src + "", target="_blank")
p #{post.media.embed_src}
else
.video
video(controls="controls", autoplay="autoplay", loop="loop")
source(src="" + post.media.source + "", type="video/mp4")
| Your browser does not support the video element.
a(href="" + post.media.source + "") [media]
else
if !post.has_media
if post.gallery
.gallery
each item in post.gallery_items
.item
div
a(href="" + item.large + "", target="_blank")
img(src=""+ item.thumbnail +"", alt="")
a(href="" + item.source + "", target="_blank", class="source-link")
small source
if post.images
.image
a(href="" + post.images.source + "")
img(src="" + post.images.source + "", alt="")
else
if post.media.not_hosted_in_reddit
if post.media.source === 'YouTube'
.video
.title
a(href="" + post.media.embed_src + "", target="_blank")
2020-12-02 17:02:32 +01:00
p #{cleanTitle(post.media.title)}
2020-12-04 22:33:40 +01:00
span(class="domain") (#{post.domain})
2020-11-17 21:44:32 +01:00
.video-holder
a(href="" + post.media.embed_src + "", target="_blank")
img(src="" + post.media.thumbnail + "")
div(class="youtube-info")
p YouTube video info:
2020-12-02 17:02:32 +01:00
p #{cleanTitle(post.media.title)} <a href="#{post.media.embed_src}">#{post.media.embed_src}</a>
2020-11-17 21:44:32 +01:00
p #{post.media.author_name} <a href="#{post.media.author_url}">#{post.media.author_url}</a>
else
if post.media.source === 'external'
if post.images
.image
a(href="" + post.media.embed_src + "", target="_blank")
img(src="" + post.images.source + "", alt="")
if !post.media.embed_src.startsWith("https://twitter.com")
p
| source:
a(href="" + post.media.embed_src + "", target="_blank")
p(class="source-url") #{post.media.embed_src}
2020-11-17 21:44:32 +01:00
else
.video
a(href="" + post.media.source + "")
img(src="" + post.media.source + "")
p Embed URL:
a(href="" + post.media.embed_src + "", target="_blank")
p #{post.media.embed_src}
else
.video
video(controls="controls", autoplay="autoplay", loop="loop")
source(src="" + post.media.source + "", type="video/mp4")
| Your browser does not support the video element.
a(href="" + post.media.source + "") [media]
2020-12-21 12:27:31 +01:00
if post.selftext
div.usertext-body !{post.selftext}
2020-11-17 21:44:32 +01:00
if viewing_comment
.infobar
p you are viewing a single comment's thread.
a(href="" + post_url + "") view the rest of the comments →
2020-12-18 18:54:05 +01:00
.comments-info
p all #{post.num_comments} comments
2020-11-17 21:44:32 +01:00
!= comments