#!/usr/bin/perl -w
#
# p4_labels_2_html for Safari
# Copyright (c) 1999 by Barrie Slaymaker, rbs@telerama.com
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the README file.
#
use strict ;
my $up_to_project = $ENV{SAF_UP_TO_PROJECT} ;
my @output ;
while (<>) {
s/&/&/g ;
s/</</g ;
s/>/>/g ;
chomp ;
if ( m/(Label\s+)(\S+)\s+(\S+)\s+(?:'\s*)?([^'].*?)\s*'?\s*$/ )
{
$_ = qq(<TR><TD>$2</TD><TD>[ <A HREF="$up_to_project\@$2/Default/">Browse</A> ]</TD><TD>$3</TD><TD>$4</TD></TR>) ;
}
else {
$_ = qq(<TR><TD><BR></TD><TD><BR></TD><TD><BR></TD><TD>$_</TD></TR>) ;
}
push( @output, $_ ) ;
}
print <<TOHERE ;
<HTML>
<HEAD>
<TITLE>Labels</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR><TH ALIGN="LEFT">Label</TH><TH><BR></TH><TH ALIGN="LEFT">Date</TH><TH ALIGN="LEFT">Description</TH></TR>
TOHERE
print( map{ $_ .= "\n" } @output ) ;
print <<TOHERE ;
</TABLE>
</BODY>
</HTML>
TOHERE
0 ;