mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-14 05:52:53 +00:00
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:
parent
3054b9f4a0
commit
bd413060c6
8 changed files with 118 additions and 7 deletions
|
@ -75,6 +75,13 @@
|
|||
<a class="post_author" href="/u/{{ post.author.name }}">u/{{ post.author.name }}</a>
|
||||
<span class="dot">•</span>
|
||||
<span class="created" title="{{ post.created }}">{{ post.rel_time }}</span>
|
||||
{% if !post.awards.is_empty() %}
|
||||
{% for award in post.awards.clone() %}
|
||||
<span class="award" title="{{ award.name }}">
|
||||
<img alt="{{ award.name }}" src="{{ award.icon_url }}" width="16" height="16"/>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</p>
|
||||
<p class="post_title">
|
||||
{% if post.flair.flair_parts.len() > 0 %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue