Support displaying awards (#168)

* Initial implementation of award parsing

* Posts: Implement awards as part of post

* Posts: remove parse_awards dead code

* Posts: initial implementation of displaying Awards at the post title

* Posts: Proxy static award images

* Client: i.redd.it should take path as argument not ID

* Posts: Just like Reddit make award size 16px

* Templates: limit the awards to 4 awards to increase performance

* Comments: Make awards a property of comments and display them

* Format and correct /img/:id

* Update comment.html

* [Optimization] Awards is not longer async

* [Revert] Posts can now display more than 4 awards again

* [Implementation] Awards not display on the frontpage

* [Implementation] Display count on awards

* Post: Start working on awards css

* Awards: Move the image size to css

* Awards: Start implementing tooltips

* Refactor awards code and tweak CSS indentation

* Unify Awards::new and Awards::parse

* Use native tooltips and brighten awards background

Co-authored-by: Spike <19519553+spikecodes@users.noreply.github.com>
This commit is contained in:
Diego Magdaleno 2021-11-24 20:08:27 -06:00 committed by GitHub
parent 3054b9f4a0
commit bd413060c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 118 additions and 7 deletions

View file

@ -272,7 +272,7 @@ main {
#column_one {
max-width: 750px;
border-radius: 5px;
overflow: hidden;
overflow: inherit;
}
footer {
@ -735,6 +735,7 @@ a.search_subreddit:hover {
.post_header {
margin: 15px 20px 5px 12px;
grid-area: post_header;
line-height: 25px;
}
.post_subreddit {
@ -774,6 +775,26 @@ a.search_subreddit:hover {
font-weight: bold;
}
.awards {
background-color: var(--foreground);
border-radius: 5px;
margin: auto;
padding: 5px;
}
.awards .award {
margin-right: 2px;
}
.award {
position: relative;
display: inline-block;
}
.award > img {
vertical-align: middle;
}
.author_flair:empty, .post_flair:empty {
display: none;
}
@ -1102,7 +1123,7 @@ summary.comment_data {
}
.compact .post_header {
margin: 15px 15px 2.5px 12px;
margin: 11px 15px 2.5px 12px;
font-size: 14px;
}