bookwyrm/fedireads/templates/book.html
Mouse Reeve 1a33290267 Edit books
Fixes #109
2020-03-28 15:06:16 -07:00

76 lines
2.5 KiB
HTML

{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
<div class="content-container user-profile">
<h2><q>{{ book.title }}</q> by
{% include 'snippets/authors.html' with book=book %}
{% if request.user.is_authenticated %}
<a href="{{ book.fedireads_key }}/edit" class="edit-link">edit
<span class="icon icon-pencil">
<span class="hidden-text">Edit Book</span>
</span>
</a>
{% endif %}
</h2>
<div>
{% if book.parent_work %}<p>Edition of <a href="/book/{{ book.parent_work.fedireads_key }}">{{ book.parent_work.title }}</a></p>{% endif %}
<div class="book-preview">
{% include 'snippets/book_cover.html' with book=book size=large %}
<p>{{ active_tab }} rating: {{ rating | stars }}</p>
{% if book.description %}
<blockquote>{{ book.description | description }}</blockquote>
{% endif %}
<div>
<div id="tag-cloud">
{% for tag in tags %}
{% include 'snippets/tag.html' with tag=tag user=request.user user_tags=user_tag_names %}
{% endfor %}
</div>
</div>
{% include 'snippets/shelve_button.html' %}
</div>
<div>
{% if request.user.is_authenticated and not book.cover %}
<form name="add-cover" method="POST" action="/upload_cover/{{book.id}}" enctype="multipart/form-data">
{% csrf_token %}
{{ cover_form.as_p }}
<button type="submit">Add cover</button>
</form>
{% endif %}
</div>
</div>
</div>
{% if request.user.is_authenticated %}
<div class="content-container">
<h2>Leave a review</h2>
<form class="review-form" name="review" action="/review/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.fedireads_key }}"></input>
{{ review_form.as_p }}
<button type="submit">Post review</button>
</form>
</div>
<div class="content-container tabs">
{% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab path=path %}
</div>
{% endif %}
{% 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 %}
{% endblock %}