2020-01-28 02:47:54 +00:00
|
|
|
{% extends 'layout.html' %}
|
2020-01-29 23:10:32 +00:00
|
|
|
{% load fr_display %}
|
2020-01-28 02:47:54 +00:00
|
|
|
{% block content %}
|
2020-04-02 02:38:07 +00:00
|
|
|
<div class="content-container">
|
|
|
|
<h2>
|
|
|
|
{% include 'snippets/book_titleby.html' with book=book %}
|
2020-03-28 22:06:16 +00:00
|
|
|
|
|
|
|
{% if request.user.is_authenticated %}
|
2020-05-04 00:53:14 +00:00
|
|
|
<a href="{{ book.id }}/edit" class="edit-link">edit
|
2020-03-28 22:06:16 +00:00
|
|
|
<span class="icon icon-pencil">
|
|
|
|
<span class="hidden-text">Edit Book</span>
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</h2>
|
2020-03-07 06:56:44 +00:00
|
|
|
|
2020-04-02 02:38:07 +00:00
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="cover-container">
|
2020-02-23 22:26:03 +00:00
|
|
|
{% include 'snippets/book_cover.html' with book=book size=large %}
|
2020-04-04 19:35:28 +00:00
|
|
|
{% include 'snippets/rate_action.html' with user=request.user book=book %}
|
2020-03-27 15:36:57 +00:00
|
|
|
{% include 'snippets/shelve_button.html' %}
|
|
|
|
|
2020-03-28 22:06:16 +00:00
|
|
|
{% if request.user.is_authenticated and not book.cover %}
|
2020-05-04 00:53:14 +00:00
|
|
|
<form name="add-cover" method="POST" action="/upload_cover/{{ book.id }}" enctype="multipart/form-data">
|
2020-03-28 22:06:16 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
{{ cover_form.as_p }}
|
|
|
|
<button type="submit">Add cover</button>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
2020-04-02 02:38:07 +00:00
|
|
|
|
|
|
|
<dl>
|
|
|
|
{% for field in info_fields %}
|
|
|
|
{% if field.value %}
|
|
|
|
<dt>{{ field.name }}:</dt>
|
|
|
|
<dd>{{ field.value }}</dd>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</dl>
|
2020-03-28 22:06:16 +00:00
|
|
|
</div>
|
2020-04-02 02:38:07 +00:00
|
|
|
|
|
|
|
<div class="column">
|
2020-04-03 19:43:49 +00:00
|
|
|
<h3>{{ active_tab }} rating: {% include 'snippets/stars.html' with rating=rating %}</h3>
|
2020-04-02 02:38:07 +00:00
|
|
|
|
|
|
|
{% include 'snippets/book_description.html' %}
|
|
|
|
|
|
|
|
{% if book.parent_work.edition_set.count > 1 %}
|
|
|
|
<p><a href="/editions/{{ book.parent_work.id }}">{{ book.parent_work.edition_set.count }} editions</a></p>
|
|
|
|
{% endif %}
|
|
|
|
|
2020-04-04 20:12:15 +00:00
|
|
|
{% if request.user.is_authenticated %}
|
2020-04-21 15:01:54 +00:00
|
|
|
<div class="compose">
|
|
|
|
{% include 'snippets/create_status.html' with book=book hide_cover=True %}
|
2020-04-02 02:38:07 +00:00
|
|
|
</div>
|
2020-04-04 20:12:15 +00:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<h3>Tags</h3>
|
|
|
|
<form name="tag" action="/tag/" method="post">
|
|
|
|
{% csrf_token %}
|
2020-05-04 00:53:14 +00:00
|
|
|
<input type="hidden" name="book" value="{{ book.id }}">
|
2020-04-21 17:47:55 +00:00
|
|
|
<input type="text" name="name">
|
2020-04-04 20:12:15 +00:00
|
|
|
<button type="submit">Add tag</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="tag-cloud">
|
|
|
|
{% for tag in tags %}
|
|
|
|
{% include 'snippets/tag.html' with book=book tag=tag user_tags=user_tags %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endif %}
|
2020-04-12 04:49:06 +00:00
|
|
|
</div>
|
2020-02-23 22:26:03 +00:00
|
|
|
</div>
|
2020-03-17 00:19:38 +00:00
|
|
|
</div>
|
2020-02-23 22:26:03 +00:00
|
|
|
|
2020-03-17 00:19:38 +00:00
|
|
|
|
2020-04-02 02:38:07 +00:00
|
|
|
{% if request.user.is_authenticated %}
|
2020-03-17 00:19:38 +00:00
|
|
|
<div class="content-container tabs">
|
2020-02-23 22:26:03 +00:00
|
|
|
{% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab path=path %}
|
2020-01-28 02:47:54 +00:00
|
|
|
</div>
|
2020-03-27 15:05:27 +00:00
|
|
|
{% endif %}
|
2020-03-17 00:19:38 +00:00
|
|
|
|
|
|
|
{% if not reviews %}
|
|
|
|
<div class="content-container">
|
|
|
|
<p>No reviews yet!</p>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% for review in reviews %}
|
|
|
|
<div class="content-container">
|
|
|
|
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2020-01-28 02:47:54 +00:00
|
|
|
{% endblock %}
|
|
|
|
|