This commit is contained in:
spikecodes 2021-02-21 20:28:04 -08:00
parent 518d5753a7
commit 80fb3a5c18
No known key found for this signature in database
GPG Key ID: 004CECFF9B463BCB
3 changed files with 11 additions and 10 deletions

View File

@ -627,6 +627,10 @@ a.search_subreddit:hover {
font-weight: bold; font-weight: bold;
} }
.post_flair:empty {
display: none;
}
.emoji { .emoji {
width: 1em; width: 1em;
height: 1em; height: 1em;

View File

@ -48,9 +48,9 @@
<p class="post_title"> <p class="post_title">
<a href="{{ post.permalink }}">{{ post.title }}</a> <a href="{{ post.permalink }}">{{ post.title }}</a>
{% if post.flair.flair_parts.len() > 0 %} {% if post.flair.flair_parts.len() > 0 %}
<a href="/r/{{ post.community }}/search/?q=flair_name%3A%22{{ post.flair.text }}%22&restrict_sr=on" class="post_flair" style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }};"> <a href="/r/{{ post.community }}/search/?q=flair_name%3A%22{{ post.flair.text }}%22&restrict_sr=on"
{% call utils::render_flair(post.flair.flair_parts) %} class="post_flair"
</a> style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }};">{% call utils::render_flair(post.flair.flair_parts) %}</a>
{% endif %} {% endif %}
{% if post.flags.nsfw %} <small class="nsfw">NSFW</small>{% endif %} {% if post.flags.nsfw %} <small class="nsfw">NSFW</small>{% endif %}
</p> </p>

View File

@ -34,10 +34,7 @@
{%- endmacro %} {%- endmacro %}
{% macro render_flair(flair_parts) -%} {% macro render_flair(flair_parts) -%}
{% for flair_part in flair_parts %} {% for flair_part in 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" && !flair_part.value.is_empty() %}<span>{{ flair_part.value }}</span>{% endif %}{% endfor %}
{% 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" && !flair_part.value.is_empty() %}<span>{{ flair_part.value }}</span>{% endif %}
{% endfor %}
{%- endmacro %} {%- endmacro %}
{% macro sub_list(current) -%} {% macro sub_list(current) -%}
@ -69,9 +66,9 @@
</p> </p>
<p class="post_title"> <p class="post_title">
{% if post.flair.flair_parts.len() > 0 %} {% if post.flair.flair_parts.len() > 0 %}
<a href="/r/{{ post.community }}/search/?q=flair_name%3A%22{{ post.flair.text }}%22&restrict_sr=on" class="post_flair" style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }};"> <a href="/r/{{ post.community }}/search/?q=flair_name%3A%22{{ post.flair.text }}%22&restrict_sr=on"
{% call render_flair(post.flair.flair_parts) %} class="post_flair"
</a> style="color:{{ post.flair.foreground_color }}; background:{{ post.flair.background_color }};">{% call render_flair(post.flair.flair_parts) %}</a>
{% endif %} {% endif %}
<a href="{{ post.permalink }}">{{ post.title }}</a>{% if post.flags.nsfw %} <small class="nsfw">NSFW</small>{% endif %} <a href="{{ post.permalink }}">{{ post.title }}</a>{% if post.flags.nsfw %} <small class="nsfw">NSFW</small>{% endif %}
</p> </p>