Start richtext flairs

This commit is contained in:
robrobinbin 2021-01-12 22:43:03 +01:00
parent 065d82a5f5
commit bbe7024323
9 changed files with 97 additions and 56 deletions

View file

@ -25,4 +25,18 @@
{% endif %}
<input type="submit" value="&rarr;">
</form>
{%- endmacro %}
{%- 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 %}
{% 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 %}