[PATCH 1/2] testbot/web: Make it possible to link to the top and bottom of the page.
The PageTitle anchor identifies the page's title while the PageEnd one points to the bottom of the page. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- testbot/lib/ObjectModel/CGI/CollectionPage.pm | 2 +- testbot/lib/ObjectModel/CGI/FormPage.pm | 2 +- testbot/lib/WineTestBot/CGI/PageBase.pm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testbot/lib/ObjectModel/CGI/CollectionPage.pm b/testbot/lib/ObjectModel/CGI/CollectionPage.pm index 6593afcd2..194379f40 100644 --- a/testbot/lib/ObjectModel/CGI/CollectionPage.pm +++ b/testbot/lib/ObjectModel/CGI/CollectionPage.pm @@ -63,7 +63,7 @@ sub GenerateTitle($) my $Title = $self->GetTitle(); if ($Title) { - print "<h1>", $self->escapeHTML($Title), "</h1>\n"; + print "<h1 id='PageTitle'>", $self->escapeHTML($Title), "</h1>\n"; } } diff --git a/testbot/lib/ObjectModel/CGI/FormPage.pm b/testbot/lib/ObjectModel/CGI/FormPage.pm index 3a41fe0e6..01f789489 100644 --- a/testbot/lib/ObjectModel/CGI/FormPage.pm +++ b/testbot/lib/ObjectModel/CGI/FormPage.pm @@ -86,7 +86,7 @@ sub GenerateTitle($) my $Title = $self->GetTitle(); if ($Title) { - print "<h1>", $self->CGI->escapeHTML($Title), "</h1>\n"; + print "<h1 id='PageTitle'>", $self->CGI->escapeHTML($Title), "</h1>\n"; } } diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm index e5b2f2d3b..0eac6b17b 100644 --- a/testbot/lib/WineTestBot/CGI/PageBase.pm +++ b/testbot/lib/WineTestBot/CGI/PageBase.pm @@ -328,7 +328,7 @@ sub GenerateFooter($) print <<EOF; </div><!--ContentContainer--> - <b class="rbottom"><b class="r4"> </b><b class="r3"> </b><b class="r2"> </b><b class="r1"> </b></b> + <b id="PageEnd" class="rbottom"><b class="r4"> </b><b class="r3"> </b><b class="r2"> </b><b class="r1"> </b></b> </div> </div><!--main_content--> -- 2.18.0
The up / down arrows simplify navigation when the long logs are expanded. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- testbot/web/JobDetails.pl | 10 ++++++++-- testbot/web/WineTestBot.css | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index 51fb2e9dd..7dd6aa5e9 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -380,13 +380,19 @@ EOF print "<div class='Content'>\n"; my $Keys = $self->SortKeys(undef, $self->{Collection}->GetKeys()); + my $KeyIndex = 0; foreach my $Key (@$Keys) { my $StepTask = $self->{Collection}->GetItem($Key); my $TaskDir = $StepTask->GetTaskDir(); my $VM = $StepTask->VM; - print "<h2><a name='k", $self->escapeHTML($Key), "'></a>" , - $self->escapeHTML($StepTask->GetTitle()), "</h2>\n"; + + my $Prev = $KeyIndex > 0 ? "k". $Keys->[$KeyIndex-1] : "PageTitle"; + my $Next = $KeyIndex + 1 < @$Keys ? "k". $Keys->[$KeyIndex+1] : "PageEnd"; + $KeyIndex++; + print "<h2><a name='k", $self->escapeHTML($Key), "'></a>", + $self->escapeHTML($StepTask->GetTitle()), + " <span class='right'><a class='title' href='#$Prev'>↑</a><a class='title' href='#$Next'>↓</a></span></h2>\n"; print "<details><summary>", $self->CGI->escapeHTML($VM->Description || $VM->Name), "</summary>", diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css index 9656254e0..55c61a300 100644 --- a/testbot/web/WineTestBot.css +++ b/testbot/web/WineTestBot.css @@ -364,6 +364,8 @@ pre background-color: red; } +.right { float: right; } + .queued { color: black; } .running { color: blue; } .success { color: green; } -- 2.18.0
participants (1)
-
Francois Gouget