Module: tools Branch: master Commit: 8c93967546fbf11e39551d85706dea4237e3af83 URL: https://source.winehq.org/git/tools.git/?a=commit;h=8c93967546fbf11e39551d85...
Author: Francois Gouget fgouget@codeweavers.com Date: Mon Mar 28 17:32:34 2022 +0200
testbot/cgi: Add support for nameless actions.
Action names starting with a dot will not be sent to the form page. This can be useful to get a clean 'get' URL.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/ObjectModel/CGI/FormPage.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/ObjectModel/CGI/FormPage.pm b/testbot/lib/ObjectModel/CGI/FormPage.pm index 2565c07..83b078b 100644 --- a/testbot/lib/ObjectModel/CGI/FormPage.pm +++ b/testbot/lib/ObjectModel/CGI/FormPage.pm @@ -555,6 +555,11 @@ Returns a list of actions that can be applied after completing or reading this form. Each action is a string which is used as the label of a button at the bottom of the form.
+If an action name starts with a dot, the button label omits the dot and the +corresponding <input> field gets no name attribute. Note that this means the +action name is not sent to the form so it probably does not make sense to have +more than one such action per form. + By default there is no action.
=back @@ -573,7 +578,9 @@ sub GenerateActions($) print "<div class='ItemActions'>\n"; foreach my $Action (@{$self->GetActions()}) { - print "<input type='submit' name='Action' value='$Action'/>\n"; + print "<input type='submit' "; + print "name='Action' " if ($Action !~ s/^.//); + print "value='$Action'/>\n"; } print "</div>\n"; }