Rich flairs
This commit is contained in:
parent
bbe7024323
commit
a4d77926b6
@ -22,7 +22,9 @@
|
||||
</div>
|
||||
<details class="comment_right" open>
|
||||
<summary class="comment_data"><a class="comment_author {% if item.author == post.author %}op{% endif %}" href="/u/{{ item.author }}">u/{{ item.author }}</a>
|
||||
{% call utils::render_flair(item.flair) %}
|
||||
{% if item.flair.flair_parts.len() > 0 %}
|
||||
<small class="author_flair">{% call utils::render_flair(item.flair.flair_parts) %}</small>
|
||||
{% endif %}
|
||||
<span class="datetime">{{ item.time }}</span>
|
||||
</summary>
|
||||
<p class="comment_body">{{ item.body }}</p>
|
||||
@ -48,13 +50,17 @@
|
||||
<a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a>
|
||||
<span class="dot">•</span>
|
||||
<a class="post_author" href="/u/{{ post.author }}">u/{{ post.author }}</a>
|
||||
{% call utils::render_flair(post.author_flair) %}
|
||||
{% if post.author_flair.flair_parts.len() > 0 %}
|
||||
<small class="author_flair">{% call utils::render_flair(post.author_flair.flair_parts) %}</small>
|
||||
{% endif %}
|
||||
<span class="dot">•</span>
|
||||
<span class="datetime">{{ post.time }}</span>
|
||||
</p>
|
||||
<a href="{{ post.permalink }}" class="post_title">
|
||||
{{ post.title }}
|
||||
{% call utils::render_flair(post.flair) %}
|
||||
{% if post.flair.flair_parts.len() > 0 %}
|
||||
<small class="post_flair" style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }}">{% call utils::render_flair(post.flair.flair_parts) %}</small>
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
<!-- POST MEDIA -->
|
||||
|
@ -34,12 +34,16 @@
|
||||
<a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a>
|
||||
<span class="dot">•</span>
|
||||
<a class="post_author" href="/u/{{ post.author }}">u/{{ post.author }}</a>
|
||||
{% call utils::render_flair(post.author_flair) %}
|
||||
{% if post.author_flair.flair_parts.len() > 0 %}
|
||||
<small class="author_flair">{% call utils::render_flair(post.author_flair.flair_parts) %}</small>
|
||||
{% endif %}
|
||||
<span class="dot">•</span>
|
||||
<span class="datetime">{{ post.time }}</span>
|
||||
</p>
|
||||
<p class="post_title">
|
||||
{% call utils::render_flair(post.flair) %}
|
||||
{% if post.flair.flair_parts.len() > 0 %}
|
||||
<small class="post_flair" style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }}">{% call utils::render_flair(post.flair.flair_parts) %}</small>
|
||||
{% endif %}
|
||||
<a href="{{ post.permalink }}">{{ post.title }}</a>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -46,7 +46,9 @@
|
||||
<span class="datetime">{{ post.time }}</span>
|
||||
</p>
|
||||
<p class="post_title">
|
||||
{% call utils::render_flair(post.flair) %}
|
||||
{% if post.flair.flair_parts.len() > 0 %}
|
||||
<small class="post_flair" style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }}">{% call utils::render_flair(post.flair.flair_parts) %}</small>
|
||||
{% endif %}
|
||||
<a href="{{ post.permalink }}">{{ post.title }}</a>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -32,7 +32,9 @@
|
||||
<div class="post_text">
|
||||
<p class="post_header">
|
||||
<a class="post_subreddit" href="/r/{{ post.community }}">r/{{ post.community }}</a>
|
||||
{% call utils::render_flair(post.author_flair) %}
|
||||
{% if post.author_flair.flair_parts.len() > 0 %}
|
||||
<small class="author_flair">{% call utils::render_flair(post.author_flair.flair_parts) %}</small>
|
||||
{% endif %}
|
||||
<span class="dot">•</span>
|
||||
<span class="datetime">{{ post.time }}</span>
|
||||
</p>
|
||||
@ -40,7 +42,7 @@
|
||||
{% if post.flair.background_color == "Comment" %}
|
||||
{% else if post.flair.background_color == "" %}
|
||||
{% else %}
|
||||
{% call utils::render_flair(post.flair) %}
|
||||
<small class="post_flair" style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }}">{% call utils::render_flair(post.flair.flair_parts) %}</small>
|
||||
{% endif %}
|
||||
<a href="{{ post.permalink }}">{{ post.title }}</a>
|
||||
</p>
|
||||
|
@ -28,15 +28,11 @@
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro render_flair(flair) -%}
|
||||
{% if flair.flair_parts.len() > 0 %}
|
||||
<small class="post_flair" style="color:{{ flair.foreground_color }}; background:{{ flair.background_color }}">
|
||||
{% for flair_part in flair.flair_parts %}
|
||||
{% for flair_part in flair %}
|
||||
{% if flair_part.flair_part_type == "emoji" %}
|
||||
<span class="emoji" style="background-image:url('{{ flair_part.value }}')"></span>
|
||||
{% else if flair_part.flair_part_type == "text" %}
|
||||
<span>{{ flair_part.value }}</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</small>
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
Loading…
Reference in New Issue
Block a user