Hides filter if shelf empty

This commit is contained in:
Ross Chapman 2023-12-05 19:37:29 -08:00
parent 979162da10
commit c65e165aeb
2 changed files with 5 additions and 2 deletions

View file

@ -4,6 +4,6 @@
{% block filter %}
<div class="control">
<label class="label" for="search_query">{% trans 'Search by keyword' %}</label>
<input aria-label="Search by keyword" id="my-books-search" class="input" type="text" name="shelves_q" placeholder="Enter text here" value="{{ shelves_search_query }}" spellcheck="false" />
<input aria-label="Search by keyword" id="my-books-search" class="input" type="text" name="shelves_q" placeholder="Enter text here" value="{{ shelves_search_query|default:'' }}" spellcheck="false" />
</div>
{% endblock %}

View file

@ -127,7 +127,10 @@
{% endwith %}
</h2>
{% include 'shelf/search_filters.html' with user=user query=query %}
{% if books|length > 0 %}
{% include 'shelf/search_filters.html' with user=user query=query %}
{% endif %}
</div>
{% if is_self and shelf.id %}
<div class="column is-narrow">