Search for books to add to lists

This commit is contained in:
Mouse Reeve
2021-01-31 11:11:26 -08:00
parent 1e9189d43c
commit 6a68fe9475
5 changed files with 46 additions and 16 deletions

View File

@ -59,10 +59,10 @@
<a href="/#feed" class="navbar-item">
Feed
</a>
{% endif %}
<a href="{% url 'lists' %}" class="navbar-item">
Lists
</a>
{% endif %}
</div>
<div class="navbar-end">

View File

@ -65,6 +65,23 @@
{% if not list.curation == 'closed' or request.user == list.user %}
<section class="column is-one-quarter">
<h2>{% if list.curation == 'open' or request.user == list.user %}Add{% else %}Suggest{% endif %} Books</h2>
<form name="search" action="{% url 'list' list.id %}" method="GET" class="block">
<div class="field has-addons">
<div class="control">
<input aria-label="Search for a book" class="input" type="text" name="q" placeholder="Search for a book" value="{{ query }}">
</div>
<div class="control">
<button class="button" type="submit">
<span class="icon icon-search" title="Search">
<span class="is-sr-only">search</span>
</span>
</button>
</div>
</div>
{% if query %}
<p class="help"><a href="{% url 'list' list.id %}">Clear search</a></p>
{% endif %}
</form>
{% for book in suggested_books %}
<div class="block columns">
<div class="column is-narrow">