Get images vertically aligned properly
[books.alexwlchan.net] / templates / list_reading.html
1 {% extends "base.html" %}
2
3 {% block content %}
4   <p class="nav">
5     <a href="/reviews">read</a> /
6     <a class="selected" href="/reading">reading</a> /
7     <a href="/to-read">to read</a>
8   </p>
9
10   <h2>books i&rsquo;m currently reading</h2>
11
12   {% for reading_entry in all_reading %}
13   {% set r = (tint_colors[reading_entry.book.cover_image][0] * 255) | int %}
14   {% set g = (tint_colors[reading_entry.book.cover_image][1] * 255) | int %}
15   {% set b = (tint_colors[reading_entry.book.cover_image][2] * 255) | int %}
16
17   <style>
18     #reading_{{ r }}_{{ g }}_{{ b }} {
19       background: rgba({{ r }}, {{ g }}, {{ b }}, 0.05);
20       border-color: rgb({{ r }}, {{ g }}, {{ b }});
21     }
22   </style>
23
24   <div class="reading" id="reading_{{ r }}_{{ g }}_{{ b }}">
25     <div class="reading_inner">
26       <div class="book_thumbnail">
27         {% set book = reading_entry.book %}
28         {% include "_book_cover.html" %}
29       </div>
30
31       <div class="book_metadata">
32         <p class="title">{{ reading_entry.book.title | smartypants | safe }}</p>
33         <p>
34           <small>
35             by {{ reading_entry.book.author }}
36             {%- if reading_entry.book.publication_year %}
37               ({{ reading_entry.book.publication_year}})
38             {%- endif -%}
39           </small>
40         </p>
41       </div>
42     </div>
43     {% if reading_entry.reading.text %}
44     <div class="note">
45       {{ reading_entry.reading.text | render_markdown | safe }}
46     </div>
47     {% endif %}
48   </div>
49   {% endfor %}
50 {% endblock %}