Allow specifying an editor as well as/instead of an author
[books.alexwlchan.net] / templates / review.html
index b35e255..7b5a7b5 100644 (file)
   <h1><span class="book-title">{{ review_entry.book.title | smartypants | safe }}</span></h1>
 
   <table class="book_metadata">
-    <tr>
-      <td>author{% if "and" in review_entry.book.author or ", " in review_entry.book.author or " & " in review_entry.book.author %}s{% endif %}:</td>
-      <th>{{ review_entry.book.author }}
-        {%- if review_entry.book.publication_year %}
-          ({{ review_entry.book.publication_year}})
-        {%- endif -%}
-      </th>
-    </tr>
+    {% if review_entry.book.author %}
+      <tr>
+        <td>author{% if "and" in review_entry.book.author or ", " in review_entry.book.author or " & " in review_entry.book.author %}s{% endif %}:</td>
+        <th>{{ review_entry.book.author }}
+          {%- if review_entry.book.publication_year %}
+            ({{ review_entry.book.publication_year}})
+          {%- endif -%}
+        </th>
+      </tr>
+    {% endif %}
+    {% if review_entry.book.editor %}
+      <tr>
+        <td>editor{% if "and" in review_entry.book.editor or ", " in review_entry.book.editor or " & " in review_entry.book.editor %}s{% endif %}:</td>
+        <th>{{ review_entry.book.editor }}
+          {%- if review_entry.book.publication_year %}
+            ({{ review_entry.book.publication_year}})
+          {%- endif -%}
+        </th>
+      </tr>
+    {% endif %}
     {% if review_entry.review.date_read %}
     <tr>
       <td>date read:</td>