2021-01-30 20:03:50 +00:00
|
|
|
{% extends 'user/user_layout.html' %}
|
2020-12-13 02:25:04 +00:00
|
|
|
{% load bookwyrm_tags %}
|
2020-11-10 21:39:37 +00:00
|
|
|
|
2021-01-30 20:03:50 +00:00
|
|
|
{% block header %}
|
|
|
|
<header class="columns">
|
|
|
|
<h1 class="title">
|
|
|
|
{% if is_self %}Your
|
|
|
|
{% else %}
|
|
|
|
{% include 'snippets/username.html' with user=user possessive=True %}
|
|
|
|
{% endif %}
|
|
|
|
shelves
|
|
|
|
</h1>
|
|
|
|
</header>
|
|
|
|
{% endblock %}
|
2020-11-10 22:52:04 +00:00
|
|
|
|
2021-01-30 20:03:50 +00:00
|
|
|
{% block panel %}
|
2020-11-10 22:52:04 +00:00
|
|
|
<div class="block columns">
|
|
|
|
<div class="column">
|
2020-11-10 22:57:44 +00:00
|
|
|
<div class="tabs" role="tablist">
|
2020-11-10 22:52:04 +00:00
|
|
|
<ul>
|
2021-02-01 19:34:08 +00:00
|
|
|
{% for shelf_tab in shelves %}
|
|
|
|
<li class="{% if shelf_tab.identifier == shelf.identifier %}is-active{% endif %}">
|
2020-11-10 22:52:04 +00:00
|
|
|
<a href="/user/{{ user | username }}/shelf/{{ shelf_tab.identifier }}" role="tab" aria-selected="{% if shelf_tab.identifier == shelf.identifier %}true{% else %}false{% endif %}">{{ shelf_tab.name }}</a>
|
|
|
|
</li>
|
2021-02-01 19:34:08 +00:00
|
|
|
{% endfor %}
|
2020-11-10 22:52:04 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-11-10 21:39:37 +00:00
|
|
|
{% if is_self %}
|
|
|
|
<div class="column is-narrow">
|
2021-01-17 16:26:28 +00:00
|
|
|
{% include 'snippets/toggle/open_button.html' with text="Create shelf" icon="plus" class="is-clickable" controls_text="create-shelf-form" %}
|
2020-11-10 21:39:37 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
2021-01-17 16:26:28 +00:00
|
|
|
<div class="hidden box mb-5" id="create-shelf-form">
|
|
|
|
<h2 class="title is-4">Create new shelf</h2>
|
|
|
|
<form name="create-shelf" action="/create-shelf/" method="post">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="id_name_create">Name:</label>
|
|
|
|
<input type="text" name="name" maxlength="100" class="input" required="true" id="id_name_create">
|
|
|
|
</div>
|
2020-02-22 00:03:05 +00:00
|
|
|
|
2021-01-17 16:26:28 +00:00
|
|
|
<label class="label">
|
|
|
|
<p>Shelf privacy:</p>
|
|
|
|
{% include 'snippets/privacy_select.html' with no_label=True %}
|
|
|
|
</label>
|
|
|
|
<div class="field is-grouped">
|
|
|
|
<button class="button is-primary" type="submit">Create shelf</button>
|
|
|
|
{% include 'snippets/toggle/close_button.html' with text="Cancel" controls_text="create-shelf-form" %}
|
2021-01-14 22:00:05 +00:00
|
|
|
</div>
|
2021-01-17 16:26:28 +00:00
|
|
|
</form>
|
2020-09-30 02:48:10 +00:00
|
|
|
</div>
|
|
|
|
|
2020-11-10 22:52:04 +00:00
|
|
|
<div class="block columns">
|
2020-11-10 21:39:37 +00:00
|
|
|
<div class="column">
|
2020-11-11 00:18:48 +00:00
|
|
|
<h2 class="title is-3">
|
|
|
|
{{ shelf.name }}
|
|
|
|
<span class="subtitle">
|
|
|
|
{% include 'snippets/privacy-icons.html' with item=shelf %}
|
|
|
|
</span>
|
|
|
|
</h2>
|
2020-11-10 21:39:37 +00:00
|
|
|
</div>
|
|
|
|
{% if is_self %}
|
|
|
|
<div class="column is-narrow">
|
2021-01-17 16:26:28 +00:00
|
|
|
{% include 'snippets/toggle/open_button.html' with text="Edit shelf" icon="pencil" class="is-clickable" controls_text="edit-shelf-form" %}
|
2020-11-10 21:39:37 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
2021-01-17 16:26:28 +00:00
|
|
|
<div class="hidden box mb-5" id="edit-shelf-form">
|
|
|
|
<h2 class="title is-4">Edit shelf</h2>
|
2021-01-19 00:38:04 +00:00
|
|
|
<form name="create-shelf" action="{{ shelf.local_path }}" method="post">
|
2021-01-17 16:26:28 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
|
|
|
{% if shelf.editable %}
|
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="id_name">Name:</label>
|
|
|
|
<input type="text" name="name" maxlength="100" class="input" required="true" value="{{ shelf.name }}" id="id_name">
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<input type="hidden" name="name" required="true" value="{{ shelf.name }}">
|
|
|
|
{% endif %}
|
2020-11-11 04:11:21 +00:00
|
|
|
|
2021-01-17 16:26:28 +00:00
|
|
|
<label class="label">
|
|
|
|
<p>Shelf privacy:</p>
|
|
|
|
{% include 'snippets/privacy_select.html' with no_label=True current=shelf.privacy %}
|
|
|
|
</label>
|
|
|
|
<div class="field is-grouped">
|
|
|
|
<button class="button is-primary" type="submit">Update shelf</button>
|
|
|
|
{% include 'snippets/toggle/close_button.html' with text="Cancel" controls_text="edit-shelf-form" %}
|
|
|
|
</div>
|
|
|
|
</form>
|
2020-11-11 04:11:21 +00:00
|
|
|
</div>
|
|
|
|
|
2020-09-29 21:11:55 +00:00
|
|
|
<div class="block">
|
2020-02-22 00:03:05 +00:00
|
|
|
<div>
|
2020-12-31 00:07:29 +00:00
|
|
|
{% include 'snippets/shelf.html' with shelf=shelf books=books ratings=ratings %}
|
2020-02-22 00:03:05 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|