From d19e73f059eada182c1024c2b0bb4afb82f4eb69 Mon Sep 17 00:00:00 2001 From: robrobinbin <> Date: Thu, 14 Jan 2021 21:45:43 +0100 Subject: [PATCH 1/2] Add placeholder for posts without thumbnail --- static/style.css | 15 +++++++++++++-- templates/search.html | 16 +++++++++++++++- templates/subreddit.html | 13 ++++++++++--- templates/user.html | 13 ++++++++++--- 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/static/style.css b/static/style.css index 0d0cf00..33d1964 100644 --- a/static/style.css +++ b/static/style.css @@ -506,7 +506,7 @@ a.search_subreddit:hover { display: grid; overflow: hidden; flex-shrink: 0; - background-color: var(--highlighted); + background-color: black; } .post_thumbnail img { @@ -517,12 +517,23 @@ a.search_subreddit:hover { justify-self: center; } +.post_thumbnail.no_thumbnail { + background-color: var(--highlighted) +} + +.post_thumbnail svg { + grid-area: 1 / 1 / 2 / 2; + align-self: center; + justify-self: center; + stroke: var(--text); +} + .post_thumbnail span { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; text-align: center; - background-color: rgba(0,0,0,0.6); + background-color: rgba(0,0,0,0.8); color: white; grid-area: 1 / 1 / 2 / 2; padding: 5px; diff --git a/templates/search.html b/templates/search.html index 4bab330..1e5eb86 100644 --- a/templates/search.html +++ b/templates/search.html @@ -64,7 +64,21 @@ - + + {% if prefs.layout == "card" && post.post_type == "image" %} + + {% else if post.post_type != "self" %} + + {% if post.thumbnail == "" %} + + + + {% else %} + + {% endif %} + {% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %} + + {% endif %} {% else %} diff --git a/templates/subreddit.html b/templates/subreddit.html index 734d295..0a61ff0 100644 --- a/templates/subreddit.html +++ b/templates/subreddit.html @@ -56,10 +56,17 @@ {% if prefs.layout == "card" && post.post_type == "image" %} - {% else if post.post_type == "link" %} - {{ post.domain }} {% else if post.post_type != "self" %} - {{ post.post_type }} + + {% if post.thumbnail == "" %} + + + + {% else %} + + {% endif %} + {% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %} + {% endif %} diff --git a/templates/user.html b/templates/user.html index 070e253..841d295 100644 --- a/templates/user.html +++ b/templates/user.html @@ -51,10 +51,17 @@ {% if prefs.layout == "card" && post.post_type == "image" %} - {% else if post.post_type == "link" %} - {{ post.domain }} {% else if post.post_type != "self" %} - {{ post.post_type }} + + {% if post.thumbnail == "" %} + + + + {% else %} + + {% endif %} + {% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %} + {% endif %} From 45660816ceb4366d159205b434b98316d3d9880f Mon Sep 17 00:00:00 2001 From: robrobinbin <> Date: Thu, 14 Jan 2021 21:53:07 +0100 Subject: [PATCH 2/2] Add cardview to search results too --- templates/search.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/search.html b/templates/search.html index 1e5eb86..6c2b836 100644 --- a/templates/search.html +++ b/templates/search.html @@ -38,7 +38,7 @@ {% if post.flags.nsfw && prefs.hide_nsfw == "on" %} {% else if post.title != "Comment" %} -
+

{{ post.score }}

{% if post.flags.nsfw %}
NSFW
{% endif %} @@ -63,7 +63,6 @@

- {% if prefs.layout == "card" && post.post_type == "image" %}