Merge pull request 'Add link flairs' (#64) from StevenNMeza/teddit:main into main

Reviewed-on: https://codeberg.org/teddit/teddit/pulls/64
This commit is contained in:
teddit 2020-12-13 21:23:03 +01:00
commit 91c7546bb0
5 changed files with 17 additions and 0 deletions

9
dist/css/styles.css vendored
View File

@ -785,6 +785,15 @@ input[type="submit"]:hover,
font-size: 12px;
margin-left: 10px;
}
.title .postflair {
display: inline-block;
border-radius: 4px;
padding: 1ch;
color: #dadada;
background-color: #6f6f6f;
font-size: 12px;
margin-left: 10px;
}
#post .submitted {
font-size: small;
color: #686868;

View File

@ -18,6 +18,7 @@ module.exports = function(fetch) {
edited: post.edited,
is_video: post.is_video,
locked: post.locked,
link_flair_text: post.link_flair_text,
name: post_id,
num_comments: post.num_comments,
permalink: teddifyUrl(post.permalink),

View File

@ -60,6 +60,7 @@ module.exports = function() {
id: data.id,
images: images,
is_video: data.is_video,
link_flair_text: data.link_flair_text,
locked: data.locked,
media: data.media,
num_comments: data.num_comments,

View File

@ -23,6 +23,8 @@ html
.title
a(href="" + post.url + "")
h2 #{cleanTitle(post.title)}
if post.link_flair_text
span(class="postflair") #{post.link_flair_text}
span(class="domain") (#{post.domain})
p.submitted
span(title="" + toUTCString(post.created) + "") submitted #{timeDifference(post.created)} by

View File

@ -84,10 +84,14 @@ html
if link.is_self_link
a(href="" + link.permalink + "")
h2(class="" + (link.stickied ? 'green' : '') + "") #{cleanTitle(link.title)}
if link.link_flair_text
span(class="postflair") #{link.link_flair_text}
span (#{link.domain})
else
a(href="" + link.url + "")
h2(class="" + (link.stickied ? 'green' : '') + "") #{cleanTitle(link.title)}
if link.link_flair_text
span(class="postflair") #{link.link_flair_text}
span (#{link.domain})
.meta
p.submitted submitted