2021-01-31 05:33:41 +00:00
|
|
|
{% extends 'layout.html' %}
|
2021-01-31 18:34:25 +00:00
|
|
|
{% load bookwyrm_tags %}
|
2021-01-31 05:33:41 +00:00
|
|
|
{% block content %}
|
|
|
|
|
2021-01-31 17:08:06 +00:00
|
|
|
<header class="columns content">
|
|
|
|
<div class="column">
|
|
|
|
<h1 class="title">{{ list.name }} <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span></h1>
|
2021-01-31 18:34:25 +00:00
|
|
|
<p class="subtitle help">Created by {% include 'snippets/username.html' with user=list.user %}</p>
|
2021-01-31 17:08:06 +00:00
|
|
|
{% include 'snippets/trimmed_text.html' with full=list.description %}
|
|
|
|
</div>
|
2021-01-31 18:34:25 +00:00
|
|
|
{% if request.user == list.user %}
|
2021-01-31 17:08:06 +00:00
|
|
|
<div class="column is-narrow">
|
2021-01-31 18:34:25 +00:00
|
|
|
{% include 'snippets/toggle/open_button.html' with text="Edit list" icon="pencil" controls_text="create-list" %}
|
2021-01-31 17:08:06 +00:00
|
|
|
</div>
|
2021-01-31 18:34:25 +00:00
|
|
|
{% endif %}
|
2021-01-31 17:08:06 +00:00
|
|
|
</header>
|
2021-01-31 05:33:41 +00:00
|
|
|
|
2021-01-31 18:34:25 +00:00
|
|
|
<form name="create-list" method="post" action="{% url 'list' list.id %}" class="box hidden" id="create-list">
|
|
|
|
<h3 class="title">Edit list</h3>
|
|
|
|
{% include 'lists/form.html' %}
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
2021-01-31 17:08:06 +00:00
|
|
|
<div class="columns content">
|
2021-01-31 18:34:25 +00:00
|
|
|
<section class="column is-three-quarters">
|
2021-01-31 17:08:06 +00:00
|
|
|
{% if not list.books.exists %}
|
|
|
|
<p>This list is currently empty</p>
|
|
|
|
{% else %}
|
2021-01-31 18:34:25 +00:00
|
|
|
<ol>
|
|
|
|
{% for item in list.listitem_set.all %}
|
|
|
|
<li class="block">
|
|
|
|
<div class="card">
|
|
|
|
<header class="card-header">
|
|
|
|
<a href="{{ book.local_path }}">{% include 'snippets/book_cover.html' with book=item.book size="medium" %}</a>
|
|
|
|
<div class="card-header-title 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.html' with book=item.book %}
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
{% if item.note %}
|
|
|
|
<div class="card-content">
|
|
|
|
{% include 'snippets/trimmed_text.html' with full=item.note %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
<div class="card-footer has-background-white-bis">
|
|
|
|
<div class="card-footer-item">
|
|
|
|
<p>Added by {% include 'snippets/username.html' with user=item.added_by %}</p>
|
|
|
|
</div>
|
2021-01-31 18:44:46 +00:00
|
|
|
{% if list.user == request.user or list.curation == 'open' and item.added_by == request.user %}
|
2021-01-31 18:34:25 +00:00
|
|
|
<form name="add-book" method="post" action="{% url 'list-add-book' list.id %}" class="card-footer-item">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="book" value="{{ book.id }}">
|
|
|
|
<button type="submit" class="button is-small is-danger">Remove</button>
|
|
|
|
</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 %}
|
|
|
|
</section>
|
|
|
|
|
2021-01-31 18:34:25 +00:00
|
|
|
{% if not list.curation == 'closed' or request.user == list.user %}
|
2021-01-31 17:08:06 +00:00
|
|
|
<section class="column is-one-quarter">
|
|
|
|
<h2>Add Books</h2>
|
|
|
|
{% for book in suggested_books %}
|
|
|
|
<div class="block columns">
|
|
|
|
<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' list.id %}">
|
|
|
|
{% csrf_token %}
|
2021-01-31 18:34:25 +00:00
|
|
|
<input type="hidden" name="book" value="{{ book.id }}">
|
2021-01-31 17:08:06 +00:00
|
|
|
<button type="submit" class="button is-small is-link">Add</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</section>
|
2021-01-31 18:34:25 +00:00
|
|
|
{% endif %}
|
2021-01-31 17:08:06 +00:00
|
|
|
</div>
|
2021-01-31 05:33:41 +00:00
|
|
|
{% endblock %}
|