custom columns: add Float type support

- remove float datatype from cc_exceptions
- handle float datatype like int or bool
- change edit template to modify input step (0.01 precision, like
  in calibre UI)
This commit is contained in:
Simon Latapie
2020-01-12 14:16:08 +01:00
parent 661ed17d23
commit cef41661dd
3 changed files with 12 additions and 7 deletions
+2 -2
View File
@@ -113,8 +113,8 @@
</select>
{% endif %}
{% if c.datatype == 'int' %}
<input type="number" step="1" class="form-control" name="{{ 'custom_column_' ~ c.id }}" id="{{ 'custom_column_' ~ c.id }}" value="{% if book['custom_column_' ~ c.id]|length > 0 %}{{ book['custom_column_' ~ c.id][0].value }}{% endif %}">
{% if c.datatype == 'int' or c.datatype == 'float' %}
<input type="number" step="{% if c.datatype == 'float' %}0.01{% else %}1{% endif %}" class="form-control" name="{{ 'custom_column_' ~ c.id }}" id="{{ 'custom_column_' ~ c.id }}" value="{% if book['custom_column_' ~ c.id]|length > 0 %}{{ book['custom_column_' ~ c.id][0].value }}{% endif %}">
{% endif %}
{% if c.datatype in ['text', 'series'] and not c.is_multiple %}