From 80fb3a5c18a86de9bcac05dfea47683921110d6b Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sun, 21 Feb 2021 20:28:04 -0800 Subject: [PATCH] Fix #110 --- static/style.css | 4 ++++ templates/post.html | 6 +++--- templates/utils.html | 11 ++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/static/style.css b/static/style.css index 9e8e14c..de30c16 100644 --- a/static/style.css +++ b/static/style.css @@ -627,6 +627,10 @@ a.search_subreddit:hover { font-weight: bold; } +.post_flair:empty { + display: none; +} + .emoji { width: 1em; height: 1em; diff --git a/templates/post.html b/templates/post.html index c6453ad..b1469fc 100644 --- a/templates/post.html +++ b/templates/post.html @@ -48,9 +48,9 @@

{{ post.title }} {% if post.flair.flair_parts.len() > 0 %} - - {% call utils::render_flair(post.flair.flair_parts) %} - + {% call utils::render_flair(post.flair.flair_parts) %} {% endif %} {% if post.flags.nsfw %} NSFW{% endif %}

diff --git a/templates/utils.html b/templates/utils.html index 2ba3bf4..27f5300 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -34,10 +34,7 @@ {%- endmacro %} {% macro render_flair(flair_parts) -%} - {% for flair_part in flair_parts %} - {% if flair_part.flair_part_type == "emoji" %} - {% else if flair_part.flair_part_type == "text" && !flair_part.value.is_empty() %}{{ flair_part.value }}{% endif %} - {% endfor %} + {% for flair_part in flair_parts %}{% if flair_part.flair_part_type == "emoji" %}{% else if flair_part.flair_part_type == "text" && !flair_part.value.is_empty() %}{{ flair_part.value }}{% endif %}{% endfor %} {%- endmacro %} {% macro sub_list(current) -%} @@ -69,9 +66,9 @@

{% if post.flair.flair_parts.len() > 0 %} - - {% call render_flair(post.flair.flair_parts) %} - + {% call render_flair(post.flair.flair_parts) %} {% endif %} {{ post.title }}{% if post.flags.nsfw %} NSFW{% endif %}