Add an entry for "Cosmogramma"
[books.alexwlchan.net] / templates / _review_entry.html
index 4c6238d..c13a5cc 100644 (file)
@@ -1,34 +1,11 @@
-{% 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>
-  #review_preview_{{ r }}_{{ g }}_{{ b }} {
-    background: rgba({{ r }}, {{ g }}, {{ b }}, 0.05);
-    border-color: rgb({{ r }}, {{ g }}, {{ b }});
-  }
-
-{% if review_entry.review.rating == 5 %}
-  #review_preview_{{ r }}_{{ g }}_{{ b }}.review_fave {
-    background: rgba({{ r }}, {{ g }}, {{ b }}, 0.2);
-    border-color: rgb({{ r }}, {{ g }}, {{ b }});
-    border-width: 3px;
-    margin-left:  -1px;
-    margin-right: -1px;
-  }
-{% endif %}
-
-  #review_preview_{{ r }}_{{ g }}_{{ b }} a:hover {
-    background: rgba({{ r }}, {{ g }}, {{ b }}, 0.3);
-  }
-
-  #review_preview_{{ r }}_{{ g }}_{{ b }} .review_preview img {
-    box-shadow: 0px 2.5px 2.5px rgba({{ r }}, {{ g }}, {{ b }}, 0.25);
-  }
+  {% include "_review_style.css" %}
 </style>
 
 <div class="review_preview {% if review_entry.review.rating == 5 and not is_index %}review_fave{% endif %}"
-id="review_preview_{{ r }}_{{ g }}_{{ b }}">
+id="review_preview_{{ review_entry.book.slug }}">
   <a href="/{{ review_entry.out_path() }}">
     <div class="book_thumbnail">
       {% set book = review_entry.book %}
@@ -36,10 +13,25 @@ id="review_preview_{{ r }}_{{ g }}_{{ b }}">
     </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 -%}
@@ -48,21 +40,23 @@ id="review_preview_{{ r }}_{{ g }}_{{ b }}">
           read {{ review_entry.review.date_read | render_date }}
             <br/>
           {% endif %}
-        </small>
 
-        <span class="star_rating">
-        {% if review_entry.review.rating %}
-          {% for _ in range(review_entry.review.rating) -%}
-          ★
-          {%- endfor -%}
-          {%- for _ in range(5 - review_entry.review.rating) -%}
-          ☆
-          {%- endfor %}
-        {% endif %}
-        </span>
-        {% if review_entry.review.did_not_finish %}
+          {% if review_entry.review.rating and not review_entry.review.did_not_finish %}
+            <span class="star_rating">
+
+            {% for _ in range(review_entry.review.rating) -%}
+            ★
+            {%- endfor -%}
+            {%- for _ in range(5 - review_entry.review.rating) -%}
+            ☆
+            {%- endfor %}
+            </span>
+          {% endif %}
+
+          {% if review_entry.review.did_not_finish %}
           (did not finish)
-        {% endif %}
+          {% endif %}
+        </small>
       </p>
     </div>
   </a>