save rating as rating*2 in db and show rating/2 in interface

This commit is contained in:
Cervinko Cera
2016-04-21 09:04:08 +02:00
parent f57c9c5951
commit a21a9d6510
2 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -37,7 +37,7 @@
</div>
<div class="form-group">
<label for="rating">Rating</label>
<input type="text" class="form-control" name="rating" id="rating" value="{% if book.ratings %}{{book.ratings[0].rating}}{% endif %}">
<input type="number" min="1" max="5" step="1" class="form-control" name="rating" id="rating" value="{% if book.ratings %}{{book.ratings[0].rating / 2}}{% endif %}">
</div>
<div class="form-group">
<label for="cover_url">Cover URL (jpg)</label>