[2/2] testbot/web: Give better titles to the job details pages.

Francois Gouget fgouget at codeweavers.com
Thu Oct 25 12:15:06 CDT 2012


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 file 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
-- 
1.7.10.4



More information about the wine-patches mailing list