Commit b7f71e56 authored by Cervinko Cera's avatar Cervinko Cera

fix for custom column 'rating'

parent 931981a3
...@@ -66,7 +66,11 @@ ...@@ -66,7 +66,11 @@
{% if entry['custom_column_' ~ c.id]|length > 0 %} {% if entry['custom_column_' ~ c.id]|length > 0 %}
{{ c.name }}: {{ c.name }}:
{% for column in entry['custom_column_' ~ c.id] %} {% 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 %} {% endfor %}
<br /> <br />
{% endif %} {% endif %}
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
{% if c.datatype == 'rating' %} {% if c.datatype == 'rating' %}
<input type="number" min="1" max="5" step="1" class="form-control" name="{{ 'custom_column_' ~ c.id }}" id="{{ 'custom_column_' ~ c.id }}" <input type="number" min="1" max="5" step="1" class="form-control" name="{{ 'custom_column_' ~ c.id }}" id="{{ 'custom_column_' ~ c.id }}"
{% if book['custom_column_' ~ c.id]|length > 0 %} {% if book['custom_column_' ~ c.id]|length > 0 %}
value="{{ book['custom_column_' ~ c.id][0].value / 2 }}" value="{{ '%d' % (book['custom_column_' ~ c.id][0].value / 2) }}"
{% endif %}> {% endif %}>
{% endif %} {% endif %}
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment