Allow specifying an editor as well as/instead of an author
[books.alexwlchan.net] / templates / _review_entry.html
index 07f0505..c4635f4 100644 (file)
@@ -7,7 +7,7 @@
 </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 %}
@@ -18,7 +18,17 @@ id="review_preview_{{ r }}_{{ g }}_{{ b }}">
       <p class="title">{{ review_entry.book.title | smartypants | safe }}</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 -%}
@@ -37,12 +47,12 @@ id="review_preview_{{ r }}_{{ g }}_{{ b }}">
             {%- for _ in range(5 - review_entry.review.rating) -%}
             ☆
             {%- endfor %}
+            </span>
+          {% endif %}
 
-            {% if review_entry.review.did_not_finish %}
-            (did not finish)
-            {% endif %}
+          {% if review_entry.review.did_not_finish %}
+          (did not finish)
           {% endif %}
-          </span>
         </small>
       </p>
     </div>