Add an entry for "Cosmogramma"
[books.alexwlchan.net] / templates / _review_entry.html
index b405a10..c13a5cc 100644 (file)
@@ -1,6 +1,4 @@
-{% set r = (tint_colors[review_entry.book.cover_image][0] * 255) | int %}
-{% set g = (tint_colors[review_entry.book.cover_image][1] * 255) | int %}
-{% set b = (tint_colors[review_entry.book.cover_image][2] * 255) | int %}
+{% set (r, g, b) = review_entry.book.cover.tint_color | from_hex %}
 
 <style>
   {% include "_review_style.css" %}
@@ -15,10 +13,25 @@ id="review_preview_{{ review_entry.book.slug }}">
     </div>
 
     <div class="book_metadata">
-      <p class="title">{{ review_entry.book.title | smartypants | safe }}</p>
+      <p class="title">
+        {{ review_entry.book.title | smartypants | safe }}
+        {% if review_entry.book.series %}
+        <span class="book-series">({{ review_entry.book.series | smartypants | safe }})</span>
+        {% endif %}
+      </p>
       <p>
         <small>
-          by {{ review_entry.book.author }}
+          {% if review_entry.book.author %}
+            by {{ review_entry.book.author }}
+            {%- if review_entry.book.editor -%}
+            ,
+            {% endif %}
+          {% endif %}
+
+          {% if review_entry.book.editor %}
+          edited by {{ review_entry.book.editor }}
+          {% endif %}
+
           {%- if review_entry.book.publication_year %}
             ({{ review_entry.book.publication_year}})
           {%- endif -%}