2021-09-06 16:48:57 +00:00
|
|
|
{% extends 'lists/layout.html' %}
|
2021-02-28 02:48:10 +00:00
|
|
|
{% load i18n %}
|
2022-01-18 20:07:46 +00:00
|
|
|
{% load rating_tags %}
|
2022-01-18 20:30:46 +00:00
|
|
|
{% load group_tags %}
|
2022-01-25 20:10:58 +00:00
|
|
|
{% load book_display_tags %}
|
2021-05-11 22:14:42 +00:00
|
|
|
{% load markdown %}
|
2022-01-24 21:37:51 +00:00
|
|
|
{% load utilities %}
|
2021-01-31 05:33:41 +00:00
|
|
|
|
2021-12-30 20:34:21 +00:00
|
|
|
{% block breadcrumbs %}
|
|
|
|
<nav class="breadcrumb subtitle" aria-label="breadcrumbs">
|
|
|
|
<ul>
|
|
|
|
<li><a href="{% url 'lists' %}">{% trans "Lists" %}</a></li>
|
|
|
|
<li class="is-active">
|
|
|
|
<a href="#" aria-current="page">
|
|
|
|
{{ list.name|truncatechars:30 }}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{% endblock %}
|
|
|
|
|
2021-02-28 18:00:36 +00:00
|
|
|
{% block panel %}
|
2021-01-31 20:07:54 +00:00
|
|
|
{% if request.user == list.user and pending_count %}
|
2021-01-31 20:30:33 +00:00
|
|
|
<div class="block content">
|
2022-01-25 21:54:44 +00:00
|
|
|
<p class="notification">
|
2021-05-11 22:14:42 +00:00
|
|
|
<a href="{% url 'list-curate' list.id %}">{{ pending_count }} book{{ pending_count|pluralize }} awaiting your approval</a>
|
2021-01-31 20:07:54 +00:00
|
|
|
</p>
|
2021-01-31 19:45:16 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-01-31 18:34:25 +00:00
|
|
|
|
2021-01-31 20:30:33 +00:00
|
|
|
<div class="columns mt-3">
|
2021-01-31 18:34:25 +00:00
|
|
|
<section class="column is-three-quarters">
|
2021-04-26 16:57:01 +00:00
|
|
|
{% if request.GET.updated %}
|
|
|
|
<div class="notification is-primary">
|
2021-10-02 08:09:15 +00:00
|
|
|
{% if list.curation != "open" and request.user != list.user and not list.group|is_member:request.user %}
|
2021-04-26 16:57:01 +00:00
|
|
|
{% trans "You successfully suggested a book for this list!" %}
|
|
|
|
{% else %}
|
|
|
|
{% trans "You successfully added a book to this list!" %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2021-04-08 16:05:21 +00:00
|
|
|
{% if not items.object_list.exists %}
|
2021-02-28 02:48:10 +00:00
|
|
|
<p>{% trans "This list is currently empty" %}</p>
|
2021-01-31 17:08:06 +00:00
|
|
|
{% else %}
|
2021-04-29 19:41:43 +00:00
|
|
|
<ol start="{{ items.start_index }}" class="ordered-list">
|
2021-01-31 19:21:50 +00:00
|
|
|
{% for item in items %}
|
2021-04-24 12:24:25 +00:00
|
|
|
<li class="block mb-5">
|
2021-01-31 18:34:25 +00:00
|
|
|
<div class="card">
|
2022-01-24 21:37:51 +00:00
|
|
|
<div class="card-content">
|
|
|
|
{% with book=item.book %}
|
|
|
|
<div class="columns is-mobile">
|
|
|
|
<div class="column is-narrow is-cover">
|
2021-04-24 12:24:25 +00:00
|
|
|
<a href="{{ item.book.local_path }}" aria-hidden="true">
|
2021-05-24 14:18:05 +00:00
|
|
|
{% include 'snippets/book_cover.html' with cover_class='is-w-auto is-h-m-tablet is-align-items-flex-start' size='medium' %}
|
2021-04-24 12:24:25 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
2022-01-24 21:37:51 +00:00
|
|
|
<div class="column">
|
2021-04-30 20:21:19 +00:00
|
|
|
<p>
|
|
|
|
{% include 'snippets/book_titleby.html' %}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{% include 'snippets/stars.html' with rating=item.book|rating:request.user %}
|
|
|
|
</p>
|
2021-05-18 17:55:05 +00:00
|
|
|
<div>
|
2021-04-30 20:21:19 +00:00
|
|
|
{{ book|book_description|to_markdown|default:""|safe|truncatewords_html:20 }}
|
2021-05-18 17:55:05 +00:00
|
|
|
</div>
|
2021-12-29 19:31:26 +00:00
|
|
|
{% include 'snippets/shelve_button/shelve_button.html' with book=book %}
|
2021-04-24 12:24:25 +00:00
|
|
|
</div>
|
2021-01-31 18:34:25 +00:00
|
|
|
</div>
|
2022-01-24 21:37:51 +00:00
|
|
|
{% endwith %}
|
2021-04-24 12:24:25 +00:00
|
|
|
|
2022-01-25 17:40:03 +00:00
|
|
|
{% if item.notes %}
|
2022-01-24 21:37:51 +00:00
|
|
|
<div class="media notification">
|
2022-01-27 20:55:53 +00:00
|
|
|
<figure class="media-left" aria-hidden="true">
|
2022-01-24 21:37:51 +00:00
|
|
|
{% include "snippets/avatar.html" with user=item.user %}
|
|
|
|
</figure>
|
|
|
|
<div class="media-content">
|
|
|
|
<div class="content">
|
|
|
|
<header>
|
2022-02-04 20:09:20 +00:00
|
|
|
{% url 'user-feed' item.user|username as user_path %}
|
2022-01-25 21:54:44 +00:00
|
|
|
{% blocktrans trimmed with username=user.display_name %}
|
2022-01-24 21:45:52 +00:00
|
|
|
<a href="{{ user_path }}">{{ username }}</a> says:
|
|
|
|
{% endblocktrans %}
|
2022-01-24 21:37:51 +00:00
|
|
|
</header>
|
2022-02-04 20:02:10 +00:00
|
|
|
{{ item.notes|to_markdown|safe }}
|
2022-01-24 21:37:51 +00:00
|
|
|
</div>
|
2022-01-24 21:56:18 +00:00
|
|
|
{% if item.user == request.user %}
|
|
|
|
<div>
|
|
|
|
<details class="details-panel box">
|
|
|
|
<summary>
|
2022-01-25 20:10:58 +00:00
|
|
|
<span role="heading" aria-level="3">
|
|
|
|
{% trans "Edit notes" %}
|
2022-02-12 15:18:56 +00:00
|
|
|
<span class="details-close icon icon-pencil" aria-hidden="true"></span>
|
2022-01-25 20:10:58 +00:00
|
|
|
</span>
|
2022-01-24 21:56:18 +00:00
|
|
|
</summary>
|
2022-02-03 18:30:30 +00:00
|
|
|
{% include "lists/edit_item_form.html" with book=item.book %}
|
2022-01-24 21:56:18 +00:00
|
|
|
</details>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2022-01-24 21:37:51 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-01-25 17:40:03 +00:00
|
|
|
{% elif item.user == request.user %}
|
|
|
|
<div>
|
|
|
|
<details class="details-panel box">
|
|
|
|
<summary>
|
2022-01-25 20:10:58 +00:00
|
|
|
<span role="heading" aria-level="3">
|
|
|
|
{% trans "Add notes" %}
|
2022-02-12 15:18:56 +00:00
|
|
|
<span class="details-close icon icon-plus" aria-hidden="true"></span>
|
2022-01-25 20:10:58 +00:00
|
|
|
</span>
|
2022-01-25 17:40:03 +00:00
|
|
|
</summary>
|
2022-02-03 18:30:30 +00:00
|
|
|
{% include "lists/edit_item_form.html" with book=item.book %}
|
2022-01-25 17:40:03 +00:00
|
|
|
</details>
|
|
|
|
</div>
|
2022-01-24 21:56:18 +00:00
|
|
|
{% endif %}
|
2022-01-24 21:37:51 +00:00
|
|
|
</div>
|
2021-05-23 15:18:16 +00:00
|
|
|
<div class="card-footer is-stacked-mobile has-background-white-bis is-align-items-stretch">
|
2021-01-31 18:34:25 +00:00
|
|
|
<div class="card-footer-item">
|
2021-12-29 19:38:53 +00:00
|
|
|
<p>
|
|
|
|
{% blocktrans trimmed with username=item.user.display_name user_path=item.user.local_path %}
|
|
|
|
Added by <a href="{{ user_path }}">{{ username }}</a>
|
|
|
|
{% endblocktrans %}
|
|
|
|
</p>
|
2021-01-31 18:34:25 +00:00
|
|
|
</div>
|
2021-10-02 23:49:38 +00:00
|
|
|
{% if list.user == request.user or list.group|is_member:request.user %}
|
2021-12-29 19:38:53 +00:00
|
|
|
<form
|
|
|
|
name="set-position-{{ item.id }}"
|
|
|
|
method="post"
|
|
|
|
action="{% url 'list-set-book-position' item.id %}"
|
|
|
|
class="card-footer-item"
|
|
|
|
>
|
|
|
|
{% csrf_token %}
|
|
|
|
<div class="field has-addons mb-0">
|
|
|
|
<div class="control">
|
|
|
|
<label for="input-list-position" class="button is-transparent is-small">{% trans "List position" %}</label>
|
2021-04-20 20:02:43 +00:00
|
|
|
</div>
|
2021-12-29 19:38:53 +00:00
|
|
|
<div class="control">
|
|
|
|
<input id="input_list_position_{{ item.id }}" class="input is-small" type="number" min="1" name="position" value="{{ item.order }}">
|
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<button type="submit" class="button is-info is-small is-tablet">{% trans "Set" %}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2021-09-27 20:31:35 +00:00
|
|
|
{% endif %}
|
2021-12-29 19:38:53 +00:00
|
|
|
|
2021-10-03 01:22:03 +00:00
|
|
|
{% if list.user == request.user or list.curation == 'open' and item.user == request.user or list.group|is_member:request.user %}
|
2021-12-29 19:38:53 +00:00
|
|
|
<form
|
|
|
|
name="remove-book-{{ item.id }}"
|
|
|
|
method="post"
|
|
|
|
action="{% url 'list-remove-book' list.id %}"
|
|
|
|
class="card-footer-item"
|
|
|
|
>
|
2021-01-31 18:34:25 +00:00
|
|
|
{% csrf_token %}
|
2021-01-31 20:15:38 +00:00
|
|
|
<input type="hidden" name="item" value="{{ item.id }}">
|
2021-02-28 02:48:10 +00:00
|
|
|
<button type="submit" class="button is-small is-danger">{% trans "Remove" %}</button>
|
2021-01-31 18:34:25 +00:00
|
|
|
</form>
|
2021-01-31 18:44:46 +00:00
|
|
|
{% endif %}
|
2021-01-31 18:34:25 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
2021-01-31 17:08:06 +00:00
|
|
|
{% endfor %}
|
2021-01-31 18:34:25 +00:00
|
|
|
</ol>
|
2021-01-31 17:08:06 +00:00
|
|
|
{% endif %}
|
2021-04-18 18:46:28 +00:00
|
|
|
{% include "snippets/pagination.html" with page=items %}
|
2021-01-31 17:08:06 +00:00
|
|
|
</section>
|
|
|
|
|
2021-04-24 12:24:25 +00:00
|
|
|
<section class="column is-one-quarter">
|
2021-05-23 15:17:30 +00:00
|
|
|
<h2 class="title is-5">
|
|
|
|
{% trans "Sort List" %}
|
|
|
|
</h2>
|
2021-04-08 16:05:21 +00:00
|
|
|
<form name="sort" action="{% url 'list' list.id %}" method="GET" class="block">
|
2021-04-29 19:41:31 +00:00
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="id_sort_by">{% trans "Sort By" %}</label>
|
|
|
|
<div class="select is-fullwidth">
|
|
|
|
{{ sort_form.sort_by }}
|
|
|
|
</div>
|
2021-04-08 16:05:21 +00:00
|
|
|
</div>
|
2021-04-29 19:41:31 +00:00
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="id_direction">{% trans "Direction" %}</label>
|
|
|
|
<div class="select is-fullwidth">
|
|
|
|
{{ sort_form.direction }}
|
|
|
|
</div>
|
2021-04-08 16:05:21 +00:00
|
|
|
</div>
|
2021-04-29 19:41:31 +00:00
|
|
|
<div class="field">
|
2021-04-08 16:05:21 +00:00
|
|
|
<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 %}
|
2021-05-23 15:17:30 +00:00
|
|
|
<h2 class="title is-5 mt-6">
|
2021-10-02 08:09:15 +00:00
|
|
|
{% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
2021-05-23 15:17:30 +00:00
|
|
|
{% trans "Add Books" %}
|
|
|
|
{% else %}
|
|
|
|
{% trans "Suggest Books" %}
|
|
|
|
{% endif %}
|
|
|
|
</h2>
|
2021-01-31 19:11:26 +00:00
|
|
|
<form name="search" action="{% url 'list' list.id %}" method="GET" class="block">
|
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="control">
|
2021-02-28 02:48:10 +00:00
|
|
|
<input aria-label="{% trans 'Search for a book' %}" class="input" type="text" name="q" placeholder="{% trans 'Search for a book' %}" value="{{ query }}">
|
2021-01-31 19:11:26 +00:00
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<button class="button" type="submit">
|
2021-02-28 02:48:10 +00:00
|
|
|
<span class="icon icon-search" title="{% trans 'Search' %}">
|
|
|
|
<span class="is-sr-only">{% trans "search" %}</span>
|
2021-01-31 19:11:26 +00:00
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if query %}
|
2021-02-28 02:48:10 +00:00
|
|
|
<p class="help"><a href="{% url 'list' list.id %}">{% trans "Clear search" %}</a></p>
|
2021-01-31 19:11:26 +00:00
|
|
|
{% endif %}
|
|
|
|
</form>
|
2021-01-31 19:13:05 +00:00
|
|
|
{% if not suggested_books %}
|
2021-02-28 02:48:10 +00:00
|
|
|
{% if query %}
|
|
|
|
<p>{% blocktrans %}No books found matching the query "{{ query }}"{% endblocktrans %}</p>{% else %}
|
|
|
|
<p>{% trans "No books found" %}</p>
|
|
|
|
{% endif %}
|
2021-01-31 19:13:05 +00:00
|
|
|
{% endif %}
|
2021-04-24 12:24:25 +00:00
|
|
|
|
|
|
|
{% if suggested_books|length > 0 %}
|
|
|
|
{% for book in suggested_books %}
|
|
|
|
<div class="columns is-mobile is-gapless">
|
2021-04-27 12:58:30 +00:00
|
|
|
<a
|
2021-04-28 08:47:14 +00:00
|
|
|
class="column is-2-mobile is-3-tablet is-cover align to-c"
|
2021-04-27 12:58:30 +00:00
|
|
|
href="{{ book.local_path }}"
|
|
|
|
aria-hidden="true"
|
|
|
|
>
|
2021-05-24 14:18:05 +00:00
|
|
|
{% include 'snippets/book_cover.html' with book=book cover_class='is-w-auto is-h-s-mobile align to-t' size='small' %}
|
2021-04-24 12:24:25 +00:00
|
|
|
</a>
|
|
|
|
|
2021-04-27 12:58:30 +00:00
|
|
|
<div class="column ml-3">
|
2021-04-24 12:24:25 +00:00
|
|
|
<p>{% include 'snippets/book_titleby.html' with book=book %}</p>
|
|
|
|
|
2022-01-25 20:10:58 +00:00
|
|
|
{% join "add_item" list.id book.id as modal_id %}
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="button is-small is-link"
|
|
|
|
data-modal-open="{{ modal_id }}"
|
2021-04-28 13:42:22 +00:00
|
|
|
>
|
2022-01-25 20:10:58 +00:00
|
|
|
{% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
|
|
|
{% trans "Add" %}
|
|
|
|
{% else %}
|
|
|
|
{% trans "Suggest" %}
|
|
|
|
{% endif %}
|
|
|
|
</button>
|
|
|
|
{% include "lists/add_item_modal.html" with id=modal_id %}
|
2021-04-24 12:24:25 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2021-02-10 21:46:56 +00:00
|
|
|
{% endif %}
|
2021-01-31 18:34:25 +00:00
|
|
|
{% endif %}
|
2021-12-04 15:17:21 +00:00
|
|
|
<div>
|
|
|
|
<h2 class="title is-5 mt-6" id="embed-label">
|
|
|
|
{% trans "Embed this list on a website" %}
|
|
|
|
</h2>
|
2021-12-22 14:13:42 +00:00
|
|
|
<div class="vertical-copy">
|
2021-12-29 19:21:21 +00:00
|
|
|
<textarea
|
|
|
|
readonly
|
|
|
|
class="textarea is-small"
|
2022-01-27 20:55:53 +00:00
|
|
|
aria-describedby="embed-label"
|
2021-12-29 19:21:21 +00:00
|
|
|
data-copytext
|
|
|
|
data-copytext-label="{% trans 'Copy embed code' %}"
|
|
|
|
data-copytext-success="{% trans 'Copied!' %}"
|
|
|
|
><iframe style="border-width:0;" id="bookwyrm_list_embed" width="400" height="600" title="{% blocktrans trimmed with list_name=list.name site_name=site.name owner=list.user.display_name %}
|
|
|
|
{{ list_name }}, a list by {{owner}} on {{ site_name }}
|
|
|
|
{% endblocktrans %}" src="{{ embed_url }}"></iframe></textarea>
|
2021-12-22 14:13:42 +00:00
|
|
|
</div>
|
2021-12-04 15:17:21 +00:00
|
|
|
</div>
|
|
|
|
|
2021-04-08 16:05:21 +00:00
|
|
|
</section>
|
2021-01-31 17:08:06 +00:00
|
|
|
</div>
|
2021-01-31 05:33:41 +00:00
|
|
|
{% endblock %}
|