teddit-reddit-frontend-alte.../views/saved.pug

102 lines
4.1 KiB
Plaintext
Raw Normal View History

2021-02-06 20:17:36 +01:00
doctype html
html
head
title saved
2022-06-10 16:09:28 +02:00
meta(property='og:title', content='saved - teddit')
include includes/meta_default.pug
include includes/meta_description.pug
2021-02-06 20:17:36 +01:00
include includes/head.pug
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
2021-02-06 20:17:36 +01:00
include includes/topbar.pug
if json === null
h1 No saved posts
else
header
a(href="/", class="main")
h1 teddit
.bottom
a(href="/saved", class="subreddit")
h2 saved
#links.sr
if json.links.length === 0
2021-02-06 20:27:21 +01:00
p No saved posts
2021-02-06 20:17:36 +01:00
else
each link in json.links
.link
.upvotes
.arrow
span #{kFormatter(link.ups)}
.arrow.down
.image
if link.images
if link.is_self_link
a(href="" + link.permalink + "")
img(src="" + link.images.thumb + "", alt="")
else
a(href=""+ link.url +"", rel="noopener noreferrer")
img(src="" + link.images.thumb + "", alt="")
else
a(href="" + link.permalink + "")
.no-image no image
.entry
.title
if link.is_self_link
a(href="" + link.permalink + "")
h2(class="" + (link.stickied ? 'green' : '') + "") #{cleanTitle(link.title)}
!= link.link_flair
span (#{link.domain})
else
a(href="" + link.url + "", rel="noopener noreferrer")
h2(class="" + (link.stickied ? 'green' : '') + "") #{cleanTitle(link.title)}
!= link.link_flair
span (#{link.domain})
.meta
p.submitted submitted
span(title="" + toUTCString(link.created) + "") #{timeDifference(link.created)} by
if link.author === '[deleted]'
span(class="deleted") [deleted]
else
a(href="/u/" + link.author + "")
| #{link.author}
!= link.user_flair
p.to to
a(href="/r/" + link.subreddit + "")
| #{link.subreddit}
if link.stickied
span(class="green") stickied
.links
if link.over_18
span.tag.nsfw NSFW
if link.selftext_html
details
summary
.line
.line
.line
.selftext
!= unescape(link.selftext_html)
if (link.images && link.images.preview)
style.
details.preview-container img {
width: 100% !important;
height: auto !important;
max-width: none !important;
max-height: none !important;
opacity: 0;
}
details.preview-container[open][data-url="#{link.images.preview}"] .preview {
width: 100%;
height: auto;
background-image: url('#{link.images.preview}');
background-repeat: no-repeat;
background-size: contain;
}
details.preview-container(data-url="" + link.images.preview + "")
summary
span ▶
.preview
img(src=""+ link.images.thumb +"", alt="")
a(href="" + link.permalink + "", class="comments") #{link.num_comments} comments
a(href="/unsave/" + link.id + "") unsave
include includes/footer.pug