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-01-29 01:23:38 +00:00
|
|
|
<div id="content">
|
|
|
|
<div>
|
|
|
|
<div class="book-preview">
|
2020-01-29 08:05:58 +00:00
|
|
|
<img class="book-cover" src="{% if book.cover %}/images/{{ book.cover }}{% else %}/static/images/no_cover.jpg{% endif %}">
|
2020-01-29 01:23:38 +00:00
|
|
|
<h1>{{ book.data.title }}</h1>
|
|
|
|
by {{ book.authors.first.data.name }}
|
2020-01-29 23:10:32 +00:00
|
|
|
{{ rating | stars }} {{ rating }}
|
2020-01-29 09:25:56 +00:00
|
|
|
<blockquote>{{ book.data.description }}</blockquote>
|
2020-01-29 01:23:38 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3>Leave a review</h3>
|
|
|
|
|
|
|
|
<form class="review-form" name="review" action="/review/" method="post">
|
2020-01-29 23:10:32 +00:00
|
|
|
{% csrf_token %}
|
2020-01-29 01:23:38 +00:00
|
|
|
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
|
2020-01-29 07:23:05 +00:00
|
|
|
{{ review_form.as_p }}
|
2020-01-29 01:23:38 +00:00
|
|
|
<button type="submit">Post review</button>
|
|
|
|
</form>
|
2020-01-28 02:47:54 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="reviews">
|
|
|
|
<h2>Reviews</h2>
|
2020-01-28 07:20:32 +00:00
|
|
|
{% if not reviews %}
|
|
|
|
<p>No reviews yet!</p>
|
|
|
|
{% endif %}
|
2020-01-28 02:47:54 +00:00
|
|
|
{% for review in reviews %}
|
2020-01-29 01:29:02 +00:00
|
|
|
<div class="review">
|
|
|
|
<h4>{{ review.name }}
|
2020-01-29 23:10:32 +00:00
|
|
|
<small>{{ review.rating | stars }} stars, by {{ review.user.username }}</small>
|
2020-01-29 01:29:02 +00:00
|
|
|
</h4>
|
|
|
|
<blockquote>{{ review.review_content }}</blockquote>
|
|
|
|
</div>
|
2020-01-28 02:47:54 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|