Rich flairs

This commit is contained in:
robrobinbin 2021-01-12 23:34:16 +01:00
parent bbe7024323
commit a4d77926b6
5 changed files with 23 additions and 13 deletions

View file

@ -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 %}