From d70496aac9dd15160ba6ca6155df5e50a260168f Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 31 Jan 2025 15:11:21 +0200 Subject: [PATCH 1/3] Fix broken Fetchmail page --- fetchmail/edit_poll.cgi | 2 -- 1 file changed, 2 deletions(-) diff --git a/fetchmail/edit_poll.cgi b/fetchmail/edit_poll.cgi index c0a8aaa6f..c8a177e43 100755 --- a/fetchmail/edit_poll.cgi +++ b/fetchmail/edit_poll.cgi @@ -125,8 +125,6 @@ foreach $u (@users) { $i++; } -print &ui_table_end(); - if ($in{'new'}) { push(@buts, [ undef, $text{'create'} ]); } From 198b25e3a3cde011413139616f3ce5f7e6f2dbbe Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 31 Jan 2025 19:25:00 +0200 Subject: [PATCH 2/3] Fix only display the bottom form when there are too many users --- fetchmail/index.cgi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fetchmail/index.cgi b/fetchmail/index.cgi index 4fecc9f76..b53d994fd 100755 --- a/fetchmail/index.cgi +++ b/fetchmail/index.cgi @@ -108,7 +108,12 @@ else { print &ui_table_row(undef, &ui_grid_table(\@grid, 4)); print &ui_table_end(); } - &show_button() if (!$toomany); + if (!$toomany) { + &show_button(1); + # Only display the bottom form when there are too many users, + # i.e. requiring page scrolling + print &ui_hide_outside_of_viewport(); + } if (&foreign_installed("cron") && $access{'cron'}) { # Show button to manage global cron job @@ -124,8 +129,11 @@ else { sub show_button { +my $bottom = shift; +my $bottom_form; +$bottom_form = 'data-outside-of-viewport' if ($bottom); if ($access{'mode'} != 3 || !$doneheader) { - print &ui_form_start("edit_poll.cgi"); + print &ui_form_start("edit_poll.cgi", "get", undef, $bottom_form); print &ui_hidden("view", 1); print &ui_submit($text{'index_ok'}); print &unix_user_input("user"); From 121b20caa0d8fe4b2bde788901f754f825b0f49a Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 31 Jan 2025 19:38:17 +0200 Subject: [PATCH 3/3] Fix button id to be more distinctive for easier styling --- fetchmail/index.cgi | 2 +- fetchmail/lang/en | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fetchmail/index.cgi b/fetchmail/index.cgi index b53d994fd..0ff399238 100755 --- a/fetchmail/index.cgi +++ b/fetchmail/index.cgi @@ -135,7 +135,7 @@ $bottom_form = 'data-outside-of-viewport' if ($bottom); if ($access{'mode'} != 3 || !$doneheader) { print &ui_form_start("edit_poll.cgi", "get", undef, $bottom_form); print &ui_hidden("view", 1); - print &ui_submit($text{'index_ok'}); + print &ui_submit($text{'index_fadd'}); print &unix_user_input("user"); print &ui_form_end(); } diff --git a/fetchmail/lang/en b/fetchmail/lang/en index a6934bf77..8463944a6 100644 --- a/fetchmail/lang/en +++ b/fetchmail/lang/en @@ -8,7 +8,7 @@ index_run=Check all servers index_global=Edit default settings. index_user=Unix user index_conf=Fetchmail configuration -index_ok=Add Fetchmail server for user: +index_fadd=Add Fetchmail server for user index_file=Fetchmail configuration in $1 index_return=server list index_start=Start Fetchmail Daemon