home · contact · privacy
Minor layout improvement to calories counter.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 18 Oct 2023 20:16:36 +0000 (22:16 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 18 Oct 2023 20:16:36 +0000 (22:16 +0200)
calories.py

index 048aaccea4fe5bd91d4789fb880c338d33a89478..5d2fc98c3aaf99ceaeae0708e6f06094370c8bc3 100644 (file)
@@ -26,8 +26,8 @@ input[type="number"] { text-align: right; }
 </tr>
 <tr>
 <input type="hidden" name="keep_visible" value="0">
 </tr>
 <tr>
 <input type="hidden" name="keep_visible" value="0">
-<td><select name="eatable_key">{eatables_selection}</select></td>
 <td class="number"><input class="unit_count" name="unit_count" type="number" step="0.1" min="0" value="0" /></td>
 <td class="number"><input class="unit_count" name="unit_count" type="number" step="0.1" min="0" value="0" /></td>
+<td><select name="eatable_key">{eatables_selection}</select></td>
 <td></td>
 </tr>
 </table>
 <td></td>
 </tr>
 </table>
@@ -290,12 +290,12 @@ class MyServer(BaseHTTPRequestHandler):
             r = db.calc_consumption(c)
             consumptions += "<tr />"\
                     "<input type=\"hidden\" name=\"keep_visible\" value=\"1\"><input name=\"eatable_key\" type=\"hidden\" value=\"%s\">"\
             r = db.calc_consumption(c)
             consumptions += "<tr />"\
                     "<input type=\"hidden\" name=\"keep_visible\" value=\"1\"><input name=\"eatable_key\" type=\"hidden\" value=\"%s\">"\
-                    "<td>%s</td>"\
                     "<td class\"number\"><input class=\"unit_count number\" name=\"unit_count\" type=\"number\" min=\"0\" step=\"0.1\" value=\"%.1f\" /></td>"\
                     "<td class\"number\"><input class=\"unit_count number\" name=\"unit_count\" type=\"number\" min=\"0\" step=\"0.1\" value=\"%.1f\" /></td>"\
+                    "<td>%s</td>"\
                     "<td></td>"\
                     "<td class=\"number\">%.1f</td>"\
                     "<td class=\"number\">%.1f</td>"\
                     "<td></td>"\
                     "<td class=\"number\">%.1f</td>"\
                     "<td class=\"number\">%.1f</td>"\
-                    "</tr>" % (c.eatable_key, db.eatables[c.eatable_key].title, c.unit_count, r["cals"], r["sugar"])
+                    "</tr>" % (c.eatable_key, c.unit_count, db.eatables[c.eatable_key].title, r["cals"], r["sugar"])
         day_rows = ""
         for date in sorted(db.days.keys()):
             day = db.days[date]
         day_rows = ""
         for date in sorted(db.days.keys()):
             day = db.days[date]