65fd6d0093679df47527ccf881eafe3f300449e4
[books.alexwlchan.net] / templates / _review_entry.html
1 {% set r = (tint_colors[review_entry.book.cover_image][0] * 255) | int %}
2 {% set g = (tint_colors[review_entry.book.cover_image][1] * 255) | int %}
3 {% set b = (tint_colors[review_entry.book.cover_image][2] * 255) | int %}
4
5 <style>
6   {% include "_review_style.css" %}
7 </style>
8
9 <div class="review_preview {% if review_entry.review.rating == 5 and not is_index %}review_fave{% endif %}"
10 id="review_preview_{{ r }}_{{ g }}_{{ b }}">
11   <a href="/{{ review_entry.out_path() }}">
12     <div class="book_thumbnail">
13       {% set book = review_entry.book %}
14       {% include "_book_cover.html" %}
15     </div>
16
17     <div class="book_metadata">
18       <p class="title">{{ review_entry.book.title | smartypants | safe }}</p>
19       <p>
20         <small>
21           by {{ review_entry.book.author }}
22           {%- if review_entry.book.publication_year %}
23             ({{ review_entry.book.publication_year}})
24           {%- endif -%}
25             <br/>
26           {% if review_entry.review.date_read %}
27           read {{ review_entry.review.date_read | render_date }}
28             <br/>
29           {% endif %}
30
31           {% if review_entry.review.rating and not review_entry.review.did_not_finish %}
32             <span class="star_rating">
33
34             {% for _ in range(review_entry.review.rating) -%}
35             ★
36             {%- endfor -%}
37             {%- for _ in range(5 - review_entry.review.rating) -%}
38             ☆
39             {%- endfor %}
40           {% endif %}
41           </span>
42
43           {% if review_entry.review.did_not_finish %}
44           (did not finish)
45           {% endif %}
46         </small>
47       </p>
48     </div>
49   </a>
50 </div>