Skip the review if a book is unrated
authorAlex Chan <alex@alexwlchan.net>
Tue, 4 Feb 2020 07:18:13 +0000 (07:18 +0000)
committerAlex Chan <alex@alexwlchan.net>
Tue, 4 Feb 2020 07:18:13 +0000 (07:18 +0000)
templates/list_reviews.html
templates/review.html

index 74160d8..26af553 100644 (file)
               read {{ review_entry.review.date_read | render_date }}
                 <br/>
               {% endif %}
-              {% for _ in range(review_entry.review.rating) %}
-              ★
-              {% endfor %}
-              {% for _ in range(5 - review_entry.review.rating) %}
-              ☆
-              {% endfor %}
-              {% if review_entry.review.did_not_finish %}
-              (did not finish)
+              {% if review_entry.review.rating %}
+                {% for _ in range(review_entry.review.rating) %}
+                ★
+                {% endfor %}
+                {% for _ in range(5 - review_entry.review.rating) %}
+                ☆
+                {% endfor %}
+                {% if review_entry.review.did_not_finish %}
+                (did not finish)
+                {% endif %}
               {% endif %}
             </small>
           </p>
index 98746f0..0b899e6 100644 (file)
@@ -25,6 +25,7 @@
       <th>{{ review_entry.review.date_read | render_date }}</th>
     </tr>
     {% endif %}
+    {% if review_entry.review.rating %}
     <tr>
       <td>rating:</td>
       <th>
@@ -39,6 +40,7 @@
         {% endif %}
       </th>
     </tr>
+    {% endif %}
   </table>
 
   {{ review_entry.review.text | render_markdown | safe }}