diff --git a/bookwyrm/templates/shelf/shelf.html b/bookwyrm/templates/shelf/shelf.html index d224b0a4f..faadd84ab 100644 --- a/bookwyrm/templates/shelf/shelf.html +++ b/bookwyrm/templates/shelf/shelf.html @@ -106,16 +106,11 @@ (showing {{ start }}-{{ end }}) {% endblocktrans %} {% endif %} - {% if show_shelves_filter_msg %} - - {% trans "We couldn't find any books that matched" %} "{{ shelves_filter_query }}" - {% endif %} {% endif %} {% endwith %} - {% if books|length > 0 %} - {% include 'shelf/shelves_filters.html' with user=user query=query %} - {% endif %} + {% include 'shelf/shelves_filters.html' with user=user query=query %} {% if is_self and shelf.id %} @@ -215,7 +210,12 @@ {% else %} -

{% trans "This shelf is empty." %}

+

{% if shelves_filter_query %} + {% trans "We couldn't find any books that matched" %} "{{ shelves_filter_query }}" + {% else %} + {% trans "This shelf is empty." %} + {% endif %} +

{% endif %} diff --git a/bookwyrm/views/shelf/shelf.py b/bookwyrm/views/shelf/shelf.py index eae57b409..17e17433f 100644 --- a/bookwyrm/views/shelf/shelf.py +++ b/bookwyrm/views/shelf/shelf.py @@ -94,8 +94,7 @@ class Shelf(View): books = sort_books(books, request.GET.get("sort")) if shelves_filter_query: - books = search(shelves_filter_query, books=books) or books - show_shelves_filter_msg = True + books = search(shelves_filter_query, books=books) paginated = Paginator( books, @@ -115,7 +114,6 @@ class Shelf(View): page.number, on_each_side=2, on_ends=1 ), "shelves_filter_query": shelves_filter_query, - "show_shelves_filter_msg": show_shelves_filter_msg, } return TemplateResponse(request, "shelf/shelf.html", data)