Skip the review if a book is unrated
[books.alexwlchan.net] / templates / review.html
1 {% extends "base.html" %}
2
3 {% block content %}
4   {% if review_entry.book.cover_image %}
5     <div class="book-cover">
6       {% set book = review_entry.book %}
7       {% include "_book_cover.html" %}
8     </div>
9   {% endif %}
10
11   <h1>My review of <span class="book-title">{{ review_entry.book.title | smartypants | safe }}</span></h1>
12
13   <table class="book_metadata">
14     <tr>
15       <td>author{% if "and" in review_entry.book.author or ", " in review_entry.book.author %}s{% endif %}:</td>
16       <th>{{ review_entry.book.author }}
17         {%- if review_entry.book.publication_year %}
18           ({{ review_entry.book.publication_year}})
19         {%- endif -%}
20       </th>
21     </tr>
22     {% if review_entry.review.date_read %}
23     <tr>
24       <td>date read:</td>
25       <th>{{ review_entry.review.date_read | render_date }}</th>
26     </tr>
27     {% endif %}
28     {% if review_entry.review.rating %}
29     <tr>
30       <td>rating:</td>
31       <th>
32         {% for _ in range(review_entry.review.rating) %}
33         ★
34         {% endfor %}
35         {% for _ in range(5 - review_entry.review.rating) %}
36         ☆
37         {% endfor %}
38         {% if review_entry.review.did_not_finish %}
39         (did not finish)
40         {% endif %}
41       </th>
42     </tr>
43     {% endif %}
44   </table>
45
46   {{ review_entry.review.text | render_markdown | safe }}
47
48   <p>(see <a href="/reviews">all reviews</a>)</p>
49 {% endblock %}