From 903e68f64a5c4eadcbfc6343ee3da5bd9dbbe81a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 2 Nov 2020 09:03:48 -0800 Subject: [PATCH] Show extended search results automatically for empty local results --- bookwyrm/templates/search_results.html | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bookwyrm/templates/search_results.html b/bookwyrm/templates/search_results.html index 6c712349..14e5fbbd 100644 --- a/bookwyrm/templates/search_results.html +++ b/bookwyrm/templates/search_results.html @@ -1,20 +1,24 @@ {% extends 'layout.html' %} {% block content %} +{% with book_results|first as local_results %}

Matching Books

+ {% if not local_results.results %} +

No books found for "{{ query }}"

+ {% else %} + {% endif %}
+ {% if book_results|slice:":1" and local_results.results %}

Didn't find what you were looking for? @@ -25,8 +29,9 @@

+ {% endif %} - +
@@ -72,4 +76,5 @@ {% endfor %}
+{% endwith %} {% endblock %}