Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit 2e24927

Browse files
committed
Fix wrong amount form submitting
1 parent 3ac9417 commit 2e24927

File tree

1 file changed

+4
-5
lines changed
  • root/templates/purchase_list

1 file changed

+4
-5
lines changed

root/templates/purchase_list/edit.tt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,15 @@ html_title = html_title _ ' for ' _ display_date(list.date, {html=>1});
4747
<form id="total-[% loop.count %]" class="d-flex justify-content-between" name="total" method="post" action="[% item.update_offset_url %]">
4848
<div class="input-group flex-nowrap">
4949
[% IF item.offset %]<span class="input-group-text px-1">ca.</span>[% END %]
50-
<input id="total" class="form-control" form="total-[% loop.count %]" type="number" min="0" step="any" name="total" list="values-[% loop.count %]" value="[% item.value + item.offset %]">
50+
<input id="total" class="form-control" type="number" min="0" step="any" name="total" list="values-[% loop.count %]" value="[% item.value + item.offset %]">
5151
<span class="input-group-text">[% display_unit( item.unit, {html=>1} ) %]</span>
5252
</div>
53-
<button class="btn btn-outline-primary ms-1 material-icons" form="total-[% loop.count %]" type="submit" title="Update amount">sync</button>
53+
<button class="btn btn-outline-primary ms-1 material-icons" type="submit" title="Update amount">sync</button>
5454
</form>
5555
[% IF item.convert_url %]
5656
<form id="units-[% loop.count %]" class="d-flex flex-wrap border rounded my-1 w-100" name="convert" method="post" action="[% item.convert_url %]">
57-
[% idx = loop.count;
58-
FOREACH unit IN item.convertible_into %]
59-
<button class="btn btn-outline-secondary btn-sm m-1" form="units-[% idx %]" type="submit" name="unit" value="[% unit.id %]">[% unit.short_name | html %]</button>
57+
[% FOREACH unit IN item.convertible_into %]
58+
<button class="btn btn-outline-secondary btn-sm m-1" type="submit" name="unit" value="[% unit.id %]">[% unit.short_name | html %]</button>
6059
[% END %]
6160
</form>
6261
[% END %]

0 commit comments

Comments
 (0)