testbot/web: Link the Patches page to the corresponding job details pages.

Francois Gouget fgouget at codeweavers.com
Thu Oct 25 12:14:01 CDT 2012


---
 testbot/web/PatchesList.pl |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/testbot/web/PatchesList.pl b/testbot/web/PatchesList.pl
index 0936019..4e3437a 100644
--- a/testbot/web/PatchesList.pl
+++ b/testbot/web/PatchesList.pl
@@ -20,6 +20,7 @@ use strict;
 
 package PatchesListPage;
 
+use URI::Escape;
 use ObjectModel::PropertyDescriptor;
 use ObjectModel::CGI::CollectionPage;
 use WineTestBot::Patches;
@@ -78,6 +79,25 @@ sub GeneratePage
   $self->SUPER::GeneratePage(@_);
 }
 
+sub GenerateDataCell
+{
+  my $self = shift;
+  my ($CollectionBlock, $Item, $PropertyDescriptor, $DetailsPage) = @_;
+
+  my $PropertyName = $PropertyDescriptor->GetName();
+  if ($PropertyName eq "Disposition" and $Item->Disposition =~ /job ([0-9]+)$/)
+  {
+    my $JobId = $1;
+    my $URI = "/JobDetails.pl?Key=" . uri_escape($JobId);
+    print "<td><a href='" . $self->escapeHTML($URI) . "'>" .
+          "Job " . $self->escapeHTML($JobId) . "</a></td>\n";
+  }
+  else
+  {
+    $self->SUPER::GenerateDataCell(@_);
+  }
+}
+
 package main;
 
 my $Request = shift;
-- 
1.7.10.4



More information about the wine-patches mailing list