forked from mirrors/bookwyrm
126 lines
6.4 KiB
HTML
126 lines
6.4 KiB
HTML
{% extends 'lists/list_layout.html' %}
|
|
{% load i18n %}
|
|
{% load bookwyrm_tags %}
|
|
|
|
{% block panel %}
|
|
{% if request.user == list.user and pending_count %}
|
|
<div class="block content">
|
|
<p>
|
|
<a href="{% url 'list-curate' list.id %}">{{ pending_count }} book{{ pending_count | pluralize }} awaiting your approval</a>
|
|
</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="columns mt-3">
|
|
<section class="column is-three-quarters">
|
|
{% if not items.object_list.exists %}
|
|
<p>{% trans "This list is currently empty" %}</p>
|
|
{% else %}
|
|
<ol start="{{ items.start_index }}">
|
|
{% for item in items %}
|
|
<li class="block pb-3">
|
|
<div class="card">
|
|
<div class="card-content columns p-0 pr-2 mb-0 is-mobile">
|
|
<div class="column is-narrow pt-0 pb-0">
|
|
<a href="{{ item.book.local_path }}">{% include 'snippets/book_cover.html' with book=item.book size="medium" %}</a>
|
|
</div>
|
|
<div class="column is-flex-direction-column is-align-items-self-start">
|
|
<span>{% include 'snippets/book_titleby.html' with book=item.book %}</span>
|
|
{% include 'snippets/stars.html' with rating=item.book|rating:request.user %}
|
|
{% include 'snippets/shelve_button/shelve_button.html' with book=item.book %}
|
|
</div>
|
|
</div>
|
|
<div class="card-footer has-background-white-bis">
|
|
<div class="card-footer-item">
|
|
<p>{% blocktrans with username=item.user.display_name user_path=user.local_path %}Added by <a href="{{ user_path }}">{{ username }}</a>{% endblocktrans %}</p>
|
|
</div>
|
|
{% if list.user == request.user or list.curation == 'open' and item.user == request.user %}
|
|
<form name="add-book" method="post" action="{% url 'list-remove-book' list.id %}" class="card-footer-item">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="item" value="{{ item.id }}">
|
|
<button type="submit" class="button is-small is-danger">{% trans "Remove" %}</button>
|
|
</form>
|
|
</div>
|
|
<div class="card-footer has-background-white-bis">
|
|
<div>
|
|
<form name="set-position" method="post" action="{% url 'list-set-book-position' item.id %}" class="card-footer-item">
|
|
{% csrf_token %}
|
|
<label for="input-list-position" class="is-sr-only">{% trans "List position" %}</label>
|
|
<input id="input-list-position" class="input" type="number" min="1" name="position" value="{{ item.order }}">
|
|
<button type="submit" class="button is-small is-info">{% trans "List position" %}</button>
|
|
</form>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ol>
|
|
{% endif %}
|
|
{% include "snippets/pagination.html" with page=items %}
|
|
</section>
|
|
|
|
<section class="column is-one-quarter content">
|
|
<h2>{% trans "Sort List" %}</h2>
|
|
<form name="sort" action="{% url 'list' list.id %}" method="GET" class="block">
|
|
<label class="label" for="id_sort_by">{% trans "Sort By" %}</label>
|
|
<div class="select is-fullwidth">
|
|
{{ sort_form.sort_by }}
|
|
</div>
|
|
<label class="label" for="id_direction">{% trans "Direction" %}</label>
|
|
<div class="select is-fullwidth">
|
|
{{ sort_form.direction }}
|
|
</div>
|
|
<div>
|
|
<button class="button is-primary is-fullwidth" type="submit">
|
|
{% trans "Sort List" %}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
{% if request.user.is_authenticated and not list.curation == 'closed' or request.user == list.user %}
|
|
<h2>{% if list.curation == 'open' or request.user == list.user %}{% trans "Add Books" %}{% else %}{% trans "Suggest Books" %}{% endif %}</h2>
|
|
<form name="search" action="{% url 'list' list.id %}" method="GET" class="block">
|
|
<div class="field has-addons">
|
|
<div class="control">
|
|
<input aria-label="{% trans 'Search for a book' %}" class="input" type="text" name="q" placeholder="{% trans 'Search for a book' %}" value="{{ query }}">
|
|
</div>
|
|
<div class="control">
|
|
<button class="button" type="submit">
|
|
<span class="icon icon-search" title="{% trans 'Search' %}">
|
|
<span class="is-sr-only">{% trans "search" %}</span>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{% if query %}
|
|
<p class="help"><a href="{% url 'list' list.id %}">{% trans "Clear search" %}</a></p>
|
|
{% endif %}
|
|
</form>
|
|
{% if not suggested_books %}
|
|
{% if query %}
|
|
<p>{% blocktrans %}No books found matching the query "{{ query }}"{% endblocktrans %}</p>{% else %}
|
|
<p>{% trans "No books found" %}</p>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% for book in suggested_books %}
|
|
{% if book %}
|
|
<div class="block columns is-mobile">
|
|
<div class="column is-narrow">
|
|
<a href="{{ book.local_path }}">{% include 'snippets/book_cover.html' with book=book size="small" %}</a>
|
|
</div>
|
|
<div class="column">
|
|
<p>{% include 'snippets/book_titleby.html' with book=book %}</p>
|
|
<form name="add-book" method="post" action="{% url 'list-add-book' %}">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="book" value="{{ book.id }}">
|
|
<input type="hidden" name="list" value="{{ list.id }}">
|
|
<button type="submit" class="button is-small is-link">{% if list.curation == 'open' or request.user == list.user %}{% trans "Add" %}{% else %}{% trans "Suggest" %}{% endif %}</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
</section>
|
|
</div>
|
|
{% endblock %}
|