Module: tools Branch: master Commit: 41b35e60772c4c7abfc0a720e0e6a22f7df2d12b URL: http://source.winehq.org/git/tools.git/?a=commit;h=41b35e60772c4c7abfc0a720e...
Author: Francois Gouget fgouget@codeweavers.com Date: Thu Oct 25 19:15:06 2012 +0200
testbot/web: Give better titles to the job details pages.
In particular show the job remarks field which is usually the patch subject line. Also arrange for this subject line to be visible in the Web browser's tab label.
---
testbot/web/JobDetails.pl | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index 50512b0..ea07014 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -39,22 +39,32 @@ sub _initialize { $JobId = $self->GetParam("JobId"); } - my $Job = CreateJobs()->GetItem($JobId); - if (! defined($Job)) + $self->{Job} = CreateJobs()->GetItem($JobId); + if (!defined $self->{Job}) { $self->Redirect("/index.pl"); } + $self->{JobId} = $JobId;
- $self->{JobId} = $Job->Id; + $self->SUPER::_initialize(@_, CreateStepsTasks($self->{Job})); +} + +sub GetPageTitle() +{ + my $self = shift;
- $self->SUPER::_initialize(@_, CreateStepsTasks($Job)); + my $PageTitle = $self->{Job}->Remarks; + $PageTitle =~ s/^[[]wine-patches[]] //; + $PageTitle = "Job " . $self->{JobId} if ($PageTitle eq ""); + $PageTitle .= " - ${ProjectName} Test Bot"; + return $PageTitle; }
sub GetTitle() { my $self = shift;
- return "Job " . $self->{JobId}; + return "Job " . $self->{JobId} . " - " . $self->{Job}->Remarks; }
sub DisplayProperty