2021-01-31 05:33:41 +00:00
|
|
|
{% extends 'layout.html' %}
|
|
|
|
{% block content %}
|
|
|
|
|
2021-01-31 16:08:52 +00:00
|
|
|
<header class="block">
|
|
|
|
<h1 class="title">Lists</h1>
|
|
|
|
</header>
|
|
|
|
|
2021-01-31 05:33:41 +00:00
|
|
|
{% if request.user.is_authenticated %}
|
2021-01-31 16:41:11 +00:00
|
|
|
<section class="block content">
|
2021-01-31 16:08:52 +00:00
|
|
|
<header class="columns">
|
|
|
|
<div class="column">
|
2021-01-31 16:41:11 +00:00
|
|
|
<h2 class="title">Your lists</h2>
|
2021-01-31 16:08:52 +00:00
|
|
|
</div>
|
|
|
|
<div class="column is-narrow">
|
|
|
|
{% include 'snippets/toggle/open_button.html' with controls_text="create-list" icon="plus" text="Create new list" %}
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
2021-01-31 16:41:11 +00:00
|
|
|
<form name="create-list" method="post" action="{% url 'lists' %}" class="box hidden" id="create-list">
|
|
|
|
<h3 class="title">Create list</h3>
|
2021-01-31 16:08:52 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
|
|
|
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column">
|
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="id_name">Name:</label>
|
|
|
|
{{ list_form.name }}
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="id_description">Description:</label>
|
|
|
|
{{ list_form.description }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="column">
|
|
|
|
<fieldset class="field">
|
|
|
|
<legend class="label">List curation:</legend>
|
|
|
|
|
|
|
|
<label class="field">
|
|
|
|
<input type="radio" name="curation" value="closed" checked> Closed
|
|
|
|
<p class="help mb-2">Only you can add and remove books to this list</p>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="field">
|
|
|
|
<input type="radio" name="curation" value="curated"> Curated
|
|
|
|
<p class="help mb-2">Anyone can suggest books, subject to your approval</p>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label class="field">
|
|
|
|
<input type="radio" name="curation" value="open"> Open
|
|
|
|
<p class="help mb-2">Anyone can add books to this list, but only you can remove them</p>
|
|
|
|
</label>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="control">
|
|
|
|
{% include 'snippets/privacy_select.html' %}
|
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<button type="submit" class="button is-primary">Save</button>
|
|
|
|
{% include 'snippets/toggle/close_button.html' with controls_text='create-list' text="Cancel" %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
{% if request.user.list_set.exists %}
|
|
|
|
<ul>
|
|
|
|
{% for list in request.user.list_set.all %}
|
2021-01-31 17:08:06 +00:00
|
|
|
<li class="block">
|
2021-01-31 16:41:11 +00:00
|
|
|
{% include 'lists/list-item.html' with list=list %}
|
2021-01-31 16:08:52 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
</section>
|
2021-01-31 05:33:41 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2021-01-31 16:08:52 +00:00
|
|
|
{% if lists.exists %}
|
2021-01-31 16:41:11 +00:00
|
|
|
<section class="block content">
|
|
|
|
<h2 class="title">Recent Lists</h2>
|
2021-01-31 16:08:52 +00:00
|
|
|
<ul>
|
|
|
|
{% for list in lists %}
|
2021-01-31 17:08:06 +00:00
|
|
|
<li class="block">
|
2021-01-31 16:41:11 +00:00
|
|
|
{% include 'lists/list-item.html' with list=list %}
|
2021-01-31 16:08:52 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
{% endif %}
|
2021-01-31 05:33:41 +00:00
|
|
|
|
|
|
|
{% endblock %}
|