From 1da4d95b2bc94857d6b4960a42f764bfa8fa39c1 Mon Sep 17 00:00:00 2001 From: Deimos Date: Tue, 12 Nov 2019 23:42:11 -0700 Subject: [PATCH] Fix strange wrapping of colon after topic type The way I was doing this before had the colon as part of the metadata, which meant that it could wrap onto the next line in thin windows, giving a result like: Article : 1500 words This changes it so that it's added with CSS after the content type when needed, so it won't wrap separately. --- tildes/scss/modules/_topic.scss | 6 ++++++ tildes/tildes/templates/macros/topics.jinja2 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tildes/scss/modules/_topic.scss b/tildes/scss/modules/_topic.scss index 47d199a..2da91b5 100644 --- a/tildes/scss/modules/_topic.scss +++ b/tildes/scss/modules/_topic.scss @@ -90,6 +90,12 @@ margin-right: 0.4rem; } +// Add a colon after the topic-content-type only when there's metadata after it +.topic-content-type:not(:last-child)::after { + content: ": "; + margin-right: 0.2rem; +} + .topic-group { margin-right: 0.4rem; } diff --git a/tildes/tildes/templates/macros/topics.jinja2 b/tildes/tildes/templates/macros/topics.jinja2 index 6381dc6..941d74b 100644 --- a/tildes/tildes/templates/macros/topics.jinja2 +++ b/tildes/tildes/templates/macros/topics.jinja2 @@ -49,7 +49,7 @@ {{ topic.content_type.display_name if topic.content_type else "Link" }} {% if topic.content_metadata_for_display %} - : {{ topic.content_metadata_for_display }} + {{ topic.content_metadata_for_display }} {% endif %} {% if topic.unimportant_tags and request.user and request.user.show_tags_in_listings %}