mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-04-18 21:45:06 -04:00
Implement a central link object
This commit is contained in:
+1
-47
@@ -137,53 +137,7 @@ html
|
||||
span.tag.nsfw NSFW
|
||||
a(href="/subreddits/search?q="+ q +"", class="btn") show more similar subreddits
|
||||
each link in json.posts
|
||||
.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
|
||||
a(href="" + link.permalink + "", class="comments")
|
||||
| #{link.num_comments} comments
|
||||
include components/link.pug
|
||||
if json.before || json.after
|
||||
.view-more-links
|
||||
if json.before && !subreddit_front
|
||||
|
||||
@@ -84,7 +84,6 @@ html
|
||||
if post.type === 't3'
|
||||
-
|
||||
var link = post;
|
||||
link.author = data.username;
|
||||
include components/link.pug
|
||||
//-.entry.t3
|
||||
//- .upvotes
|
||||
|
||||
Reference in New Issue
Block a user