Skip the review if a book is unrated
[books.alexwlchan.net] / templates / list_reviews.html
1 {% extends "base.html" %}
2
3 {% block content %}
4   <p class="nav">
5     <a class="selected" href="/reviews">read</a> /
6     <a href="/reading">reading</a> /
7     <a href="/to-read">to read</a>
8   </p>
9
10   <h2>books i&rsquo;ve read</h2>
11
12   <p id="jump_to">jump to:
13     {% for year, _ in all_reviews %}
14     <a href="#books_by_year_{{ year }}">
15       {% if year %}{{ year }}{% else %}other times{% endif -%}
16     </a>
17     {% if not loop.last %} / {% endif %}
18     {% endfor %}
19   </p>
20
21   {% for year, reviews in all_reviews %}
22   <div class="divider">{{ loop.cycle('&#x2766;', '&#x2767;') | safe }}</div>
23
24   <div class="books_by_year" id="books_by_year_{{ year }}">
25     <h3>the {{ reviews|length }} book{% if reviews|length != 1 %}s{% endif %}
26       {% if year == this_year %}
27         i&rsquo;ve read so far
28       {% else %}
29         i read
30       {% endif %}
31
32       {% if year %}
33         in {{ year }}
34       {% else %}
35         at another time
36       {% endif %}
37     </h3>
38
39     {% for review_entry in reviews %}
40     <div class="review_preview {% if review_entry.review.rating == 5 %}review_fave{% endif %}">
41       <a href="/{{ review_entry.out_path() }}">
42         <div class="book_thumbnail">
43           {% set book = review_entry.book %}
44           {% include "_book_cover.html" %}
45         </div>
46
47         <div class="book_metadata">
48           <p class="title">{{ review_entry.book.title | smartypants | safe }}</p>
49           <p>
50             <small>
51               by {{ review_entry.book.author }}
52               {%- if review_entry.book.publication_year %}
53                 ({{ review_entry.book.publication_year}})
54               {%- endif -%}
55                 <br/>
56               {% if review_entry.review.date_read %}
57               read {{ review_entry.review.date_read | render_date }}
58                 <br/>
59               {% endif %}
60               {% if review_entry.review.rating %}
61                 {% for _ in range(review_entry.review.rating) %}
62                 ★
63                 {% endfor %}
64                 {% for _ in range(5 - review_entry.review.rating) %}
65                 ☆
66                 {% endfor %}
67                 {% if review_entry.review.did_not_finish %}
68                 (did not finish)
69                 {% endif %}
70               {% endif %}
71             </small>
72           </p>
73         </div>
74       </a>
75     </div>
76     {% endfor %}
77   </div>
78
79   {% endfor %}
80 {% endblock %}