2020-01-28 02:47:54 +00:00
|
|
|
{% extends 'layout.html' %}
|
|
|
|
{% block content %}
|
2020-01-29 01:23:38 +00:00
|
|
|
<div id="content">
|
|
|
|
<div>
|
|
|
|
<div class="book-preview">
|
|
|
|
<img class="book-cover" src="/static/images/med.jpg">
|
|
|
|
<h1>{{ book.data.title }}</h1>
|
|
|
|
by {{ book.authors.first.data.name }}
|
|
|
|
{{ rating }} stars
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3>Leave a review</h3>
|
|
|
|
|
|
|
|
<form class="review-form" name="review" action="/review/" method="post">
|
|
|
|
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
|
|
|
|
<label for="name">Title:
|
|
|
|
<input type="text" name="name"></input>
|
|
|
|
</label>
|
|
|
|
<label for="content">
|
|
|
|
<textarea name="content"></textarea>
|
|
|
|
</label>
|
|
|
|
<label for="rating">Your rating (1-5)
|
|
|
|
<input type="number" name="rating"></input>
|
|
|
|
</label>
|
|
|
|
<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 }}
|
|
|
|
<small>{{ review.rating }} stars, by {{ review.user.username }}</small>
|
|
|
|
</h4>
|
|
|
|
<blockquote>{{ review.review_content }}</blockquote>
|
|
|
|
</div>
|
2020-01-28 02:47:54 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|