show "done" button only on last page

This commit is contained in:
whosit 2025-03-23 18:38:02 +03:00
parent 66e0b4f706
commit 4e278feed1

View File

@ -287,7 +287,6 @@ local function show_vote_ballot(username)
{command = "addlabel", label = categories[3], X = 13.9, Y = 0.4, W = 1.6, H = 1.0},
{command = "addlabel", label = categories[4], X = 15.7, Y = 0.4, W = 1.6, H = 1.0},
{command = "addlabel", label = "Your choices are saved automatically!", X = 11.5, Y = 12.1},
{command = "addbutton", name = "vote_done", label = "Done", X = 14.0, Y = 12.5, W = 3, H = 1},
{command = "addlabel", label = ("Page %s/%s"):format(mem.ballot_page+1, total_pages), X = 0.8, Y = 12.5}
}
digiline_send("vote", c1)
@ -330,6 +329,8 @@ local function show_vote_ballot(username)
end
if (mem.ballot_page + 1) < total_pages then
table.insert(c, {command = "addbutton", name = "ballot_page_next", label = "Next page", X = 5.5, Y = 12.5, W = 3, H = 1})
elseif mem.ballot_page + 1 == total_pages then
table.insert(c, {command = "addbutton", name = "vote_done", label = "Done", X = 14.0, Y = 12.5, W = 3, H = 1})
end
digiline_send("vote", c)