<tr>
<input type="hidden" name="keep_visible" value="0">
<td><select name="eatable_key">{eatables_selection}</select></td>
-<td><input class="unit_count" name="unit_count" type="number" step="1" min="0" value="0" /></td>
+<td><input class="unit_count" name="unit_count" type="number" step="0.1" min="0" value="0" /></td>
<td></td>
</tr>
</table>
button.innerHTML = '+1';
button.onclick = function(event) {
event.preventDefault();
- input.value = parseInt(input.value) + 1;
+ input.value = parseFloat(input.value) + 1.0;
};
input.insertAdjacentElement('afterend', button);
}
if c.unit_count > 0:
db.eatables[c.eatable_key].popularity += 1
db.consumptions = []
- default_slots = 7
+ default_slots = 10
for k, v in sorted(db.eatables.items(), key=lambda item: -item[1].popularity):
db.add_consumption(Consumption(k, 0))
default_slots -= 1
consumptions += "<tr />"\
"<input type=\"hidden\" name=\"keep_visible\" value=\"1\">"\
"<td><select name=\"eatable_key\">%s</select></td>"\
- "<td><input class=\"unit_count\" name=\"unit_count\" type=\"number\" min=\"0\" value=\"%d\" /></td>"\
+ "<td><input class=\"unit_count\" name=\"unit_count\" type=\"number\" min=\"0\" step=\"0.1\" value=\"%.1f\" /></td>"\
"<td></td>"\
"<td>%.1f</td>"\
"<td>%.1f</td>"\