From b7f71e563e0033095bdf0a2e5b3cf3059b363aad Mon Sep 17 00:00:00 2001 From: Cervinko Cera Date: Thu, 21 Apr 2016 12:59:49 +0200 Subject: [PATCH] fix for custom column 'rating' --- cps/templates/detail.html | 6 +++++- cps/templates/edit_book.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 5cf9d5e2..3fa85b52 100644 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -66,7 +66,11 @@ {% if entry['custom_column_' ~ c.id]|length > 0 %} {{ c.name }}: {% for column in entry['custom_column_' ~ c.id] %} - {{ column.value }} + {% if c.datatype == 'rating' %} + {{ '%d' % (column.value / 2) }} + {% else %} + {{ '%d' % (column.value / 2) }} + {% endif %} {% endfor %}
{% endif %} diff --git a/cps/templates/edit_book.html b/cps/templates/edit_book.html index 7b74d7e2..b553db18 100644 --- a/cps/templates/edit_book.html +++ b/cps/templates/edit_book.html @@ -70,7 +70,7 @@ {% if c.datatype == 'rating' %} 0 %} - value="{{ book['custom_column_' ~ c.id][0].value / 2 }}" + value="{{ '%d' % (book['custom_column_' ~ c.id][0].value / 2) }}" {% endif %}> {% endif %}