Module: tools Branch: master Commit: 7c2969f88d6167034b58ff9f89139d14ea89162c URL: https://source.winehq.org/git/tools.git/?a=commit;h=7c2969f88d6167034b58ff9f...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Jul 6 16:05:28 2022 +0200
testbot/cgi: Highlight the name of the invalid field(s) on form errors.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/ObjectModel/CGI/FormPage.pm | 4 +++- testbot/web/WineTestBot.css | 1 + 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/ObjectModel/CGI/FormPage.pm b/testbot/lib/ObjectModel/CGI/FormPage.pm index f2fd0f09..67b3fa00 100644 --- a/testbot/lib/ObjectModel/CGI/FormPage.pm +++ b/testbot/lib/ObjectModel/CGI/FormPage.pm @@ -432,7 +432,9 @@ sub GenerateField($$$$) { my ($self, $PropertyDescriptor, $Display, $Format) = @_;
- print "<div class='ItemProperty'><label>", + my $Class = $self->IsErrField($PropertyDescriptor->GetName()) ? + " class='errorfield'" : ""; + print "<div class='ItemProperty'><label$Class>", $self->escapeHTML($self->GetDisplayName($PropertyDescriptor)), "</label>";
diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css index 78d33f88..fd6acac8 100644 --- a/testbot/web/WineTestBot.css +++ b/testbot/web/WineTestBot.css @@ -377,6 +377,7 @@ pre margin-bottom: 2em; background-color: red; } +.errorfield { color: red; }
.right { float: right; }