add some missing files, complete separation of templates, factor common page wrapper...
authorAndrew Dunstan <andrew@dunslane.net>
Wed, 13 Oct 2010 15:10:26 +0000 (15:10 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Wed, 13 Oct 2010 15:10:26 +0000 (15:10 +0000)
18 files changed:
cgi-bin/addnotes.pl [new file with mode: 0755]
cgi-bin/register.pl
cgi-bin/show_members.pl
htdocs/img/git.png [new file with mode: 0644]
htdocs/img/info.gif [new file with mode: 0644]
htdocs/img/vpath.png [new file with mode: 0644]
htdocs/index.html
templates/bfwrapper.tt [deleted file]
templates/dashboard.tt [deleted file]
templates/history.tt
templates/index.tt [new file with mode: 0644]
templates/log.tt
templates/members.tt
templates/page.tt [new file with mode: 0644]
templates/register-form.tt
templates/register-incomplete.tt [new file with mode: 0644]
templates/register-ok.tt [new file with mode: 0644]
templates/status.tt

diff --git a/cgi-bin/addnotes.pl b/cgi-bin/addnotes.pl
new file mode 100755 (executable)
index 0000000..acab114
--- /dev/null
@@ -0,0 +1,116 @@
+#!/usr/bin/perl
+
+use strict;
+
+use CGI;
+use Digest::SHA1  qw(sha1_hex);
+use MIME::Base64;
+use DBI;
+use DBD::Pg;
+use Data::Dumper;
+
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport);
+
+my $query = new CGI;
+
+my $sig = $query->path_info;
+$sig =~ s!^/!!;
+
+my $animal = $query->param('animal');
+my $sysnotes = $query->param('sysnotes');
+
+my $content = "animal=$animal\&sysnotes=$sysnotes";
+
+require "$ENV{BFConfDir}/BuildFarmWeb.pl";
+
+die "no dbname" unless $dbname;
+die "no dbuser" unless $dbuser;
+
+my $dsn="dbi:Pg:dbname=$dbname";
+$dsn .= ";host=$dbhost" if $dbhost;
+$dsn .= ";port=$dbport" if $dbport;
+
+unless ($animal && defined($sysnotes) && $sig)
+{
+       print 
+           "Status: 490 bad parameters\nContent-Type: text/plain\n\n",
+           "bad parameters for request\n";
+       exit;
+       
+}
+
+
+my $db = DBI->connect($dsn,$dbuser,$dbpass);
+
+die $DBI::errstr unless $db;
+
+my $gethost=
+    "select secret from buildsystems where name = ? and status = 'approved'";
+my $sth = $db->prepare($gethost);
+$sth->execute($animal);
+my ($secret)=$sth->fetchrow_array();
+$sth->finish;
+
+
+unless ($secret)
+{
+       print 
+           "Status: 495 Unknown System\nContent-Type: text/plain\n\n",
+           "System $animal is unknown\n";
+       $db->disconnect;
+       exit;
+       
+}
+
+
+
+
+my $calc_sig = sha1_hex($content,$secret);
+
+if ($calc_sig ne $sig)
+{
+
+       print "Status: 450 sig mismatch\nContent-Type: text/plain\n\n";
+       print "$sig mismatches $calc_sig on content:\n$content";
+       $db->disconnect;
+       exit;
+}
+
+# undo escape-proofing of base64 data and decode it
+map {tr/$@/+=/; $_ = decode_base64($_); } 
+    ($sysnotes);
+
+my  $set_notes = q{
+
+    update buildsystems
+    set sys_notes = nullif($2,''), 
+    sys_notes_ts = case 
+                      when coalesce($2,'') <> '' then now() 
+                      else null 
+                   end
+    where name = $1
+          and status = 'approved'
+
+};
+
+$sth = $db->prepare($set_notes);
+my $rv = $sth->execute($animal,$sysnotes);
+unless($rv)
+{
+       print "Status: 460 old data fetch\nContent-Type: text/plain\n\n";
+       print "error: ",$db->errstr,"\n";
+       $db->disconnect;
+       exit;
+}
+
+$sth->finish;
+
+
+
+$db->disconnect;
+
+print "Content-Type: text/plain\n\n";
+print "request was on:\n$content\n";
+
+
+
index 7f8d6fc1d50647be9bbacece7f70889568420717..b15a0e24cf88862c4699a604aff695217f641617 100755 (executable)
@@ -7,61 +7,16 @@ use CGI;
 use Template;
 use Captcha::reCAPTCHA;
 
-use vars qw($dbhost $dbname $dbuser $dbpass $dbport $notifyapp $captcha_pubkey $captcha_privkey);
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport $notifyapp $captcha_pubkey $captcha_privkey $template_dir);
 
 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
-#require "BuildFarmWeb.pl";
 
 my $dsn="dbi:Pg:dbname=$dbname";
 $dsn .= ";host=$dbhost" if $dbhost;
 $dsn .= ";port=$dbport" if $dbport;
 
-my $header = <<EOS;
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-       <title>PostgreSQL BuildFarm Application</title>
-       <link rel="icon" type="image/png" href="/elephant-icon.png" />
-       <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
-       <style type="text/css"><!--
-       li#register a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; } 
-       li#register { background: url(/inc/b/l.png) no-repeat 0% -20px; }
-       --></style>
-</head>
-<body class="application">
-<div id="wrapper">
-<div id="banner">
-<a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
-<div id="nav">
-<ul>
-    <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
-    <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
-    <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
-    <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
-    <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
-    <li id="postgresql.org"><a href="http://www.postgresql.org">PostgreSQL.org</a></li>
-</ul>
-</div><!-- nav -->
-</div><!-- banner -->
-<div id="main">
-EOS
-
-my $footer = <<EOS;
-</div><!-- main -->
-<hr />
-<p style="text-align: center;">
-Hosting for the PostgreSQL Buildfarm is generously 
-provided by: 
-<a href="http://www.commandprompt.com">CommandPrompt, 
-The PostgreSQL Company</a>
-</p>
-</div><!-- wrapper -->
-</body>
-</html>
-EOS
-
+my $template_opts = { INCLUDE_PATH => $template_dir};
+my $template = new Template($template_opts);
 my $query = new CGI;
 
 my $params = $query->Vars;
@@ -80,11 +35,9 @@ my $captcha_ok = $captcha->check_answer
 
 unless ($os && $osv && $comp && $compv && $arch && $email && $owner && $captcha_ok->{is_valid})
 {
-       print "Content-Type: text/html\n\n",
-       $header,
-       "<p>You need to complete all the form items. <a href=\"/cgi-bin/register-form.pl\">Please try again.</a></p>\n",
-       $footer;
-       exit;
+    print "Content-Type: text/html\n\n";
+    $template->process('register-incomplete.tt');
+    exit;
 }
 
 # some idiot has a script that tries to talk to me
@@ -157,12 +110,10 @@ my $sth=$db->prepare($statement);
 my $rv=$sth->execute($dummyname,$secret,$os,$osv,$comp,$compv,
                          $arch,$owner,$email);
 my $err=$db->errstr;
-print "Content-type: text/html\n\n";
-print $header
-    , "<h1>PostgreSQL BuildFarm Application received</h1>\n"
-    , "<p>Thank you. You should hear from us shortly.</p>"
-    , $footer;
 
+# everything looks OK, so tell them so
+print "Content-type: text/html\n\n";
+$template->process('register-ok.tt');
 
 $sth->finish;
 $db->disconnect;
index 2b6e0be40d7cac8e04c305d7a3f6e0c16e9f4544..61c621ae0bf6cf0657d8e449ac3964b073b5594c 100755 (executable)
@@ -31,7 +31,7 @@ my $db = DBI->connect($dsn,$dbuser,$dbpass);
 # there is possibly some redundancy in this query, but it makes
 # a lot of the processing simpler.
 
-my $statement = <<EOS;
+my $statement = q{
 
   select name, operating_system, os_version, compiler, compiler_version, owner_email, 
     architecture as arch, ARRAY(
@@ -40,13 +40,17 @@ my $statement = <<EOS;
                                from build_status_latest l 
                                where l.sysname = s.name
                                order by branch <> 'HEAD', branch desc 
-                               ) as branches 
+                               ) as branches, 
+                         ARRAY(select compiler_version || '\t' ||  os_version || '\t' || effective_date
+                               from personality p
+                               where p.name = s.name 
+                               order by effective_date
+                               ) as personalities
   from buildsystems s
   where status = 'approved'
-  order by $sort_by
+};
 
-EOS
-;
+$statement .= "order by $sort_by";
 
 my $statrows=[];
 my $sth=$db->prepare($statement);
@@ -54,6 +58,19 @@ $sth->execute;
 while (my $row = $sth->fetchrow_hashref)
 {
     $row->{branches} =~ s/^\{(.*)\}$/$1/;
+    my $personalities = $row->{personalities};
+    $personalities =~ s/^\{(.*)\}$/$1/;
+    my @personalities = split($personalities,',');
+    $row->{personalities} = [];
+    foreach my $personality (@personalities)
+    {
+       $personality =~ s/^"(.*)"$/$1/;
+       $personality =~ s/\\(.)/$1/g;
+       my ($compiler_version, $os_version, $effective_date) = split(/\t/,$personality);
+       push(@{$row->{personalities}}, {compiler_version => $compiler_version, 
+                                       os_version => $os_version, 
+                                       effective_date => $effective_date });
+    }
     $row->{owner_email} =~ s/\@/ [ a t ] /;
     push(@$statrows,$row);
 }
diff --git a/htdocs/img/git.png b/htdocs/img/git.png
new file mode 100644 (file)
index 0000000..de637c0
Binary files /dev/null and b/htdocs/img/git.png differ
diff --git a/htdocs/img/info.gif b/htdocs/img/info.gif
new file mode 100644 (file)
index 0000000..ef510fa
Binary files /dev/null and b/htdocs/img/info.gif differ
diff --git a/htdocs/img/vpath.png b/htdocs/img/vpath.png
new file mode 100644 (file)
index 0000000..9859b01
Binary files /dev/null and b/htdocs/img/vpath.png differ
index 0968db1325f5807cd083b8fe4ed2b2f596ec1cf5..b17ceb2c6671fdcb8d3f100254d0c9724efaaa0c 100644 (file)
@@ -1,31 +1,33 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-       <title>PostgreSQL BuildFarm</title>
-       <link rel="icon" type="image/png" href="/elephant-icon.png" />
-       <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
-       <style type="text/css"><!--
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <title>PostgreSQL BuildFarm</title>
+    <link rel="icon" type="image/png" href="/elephant-icon.png" />
+    <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
+    <style type="text/css"><!--
        li#home a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; } 
        li#home { background: url(/inc/b/l.png) no-repeat 0% -20px; }
-       --></style>
-</head>
-<body>
-<div id="wrapper">
-<div id="banner">
-<a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
-<div id="nav">
-<ul>
-    <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
-    <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
-    <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
-    <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
-    <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
-</ul>
-</div><!-- nav -->
-</div><!-- banner -->
-<div id="main">
+    --></style>
+  </head>
+  <body class="none">
+    <div id="wrapper">
+      <div id="banner">
+        <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
+        <div id="nav">
+          <ul>
+           <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
+           <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
+           <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
+           <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
+           <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
+          </ul>
+        </div><!-- nav -->
+      </div><!-- banner -->
+      <div id="main">
+        
+<!-- html generated from index.tt -->
 <p>
 The PostgreSQL build farm is a distributed system for automatically testing
 changes in the source code for PostgreSQL as they occur, on a wide variety
@@ -42,22 +44,23 @@ the <a href="/cgi-bin/register-form.pl" title="Register">Registration Page</a>.
 We are particularly interested in unusual platforms or combinations of
 architecture, operating system and compiler.
 </p>
-<p>To see what is involved in running a buildfarm member, please visit the
+<p>To see what is involved in running a buildfarm member, please 
+read <a href="http://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto">http://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto</a>.
+The client code can be found at the
 <a href="http://pgfoundry.org/projects/pgbuildfarm/">project page</a> at 
-<a href="http://pgfoundry.org/">PGFoundry</a> and
-especially read the 
-<a href="http://pgfoundry.org/docman/view.php/1000040/4/PGBuildFarm-HOWTO.txt">HowTo documentation</a>.
+<a href="http://pgfoundry.org/">PGFoundry</a>.
 </p>
 <p>The build farm software should run on all platforms that can support PostgreSQL.
 </p>
-</div><!-- main -->
-<hr />
-<p style="text-align: center;">
-Hosting for the PostgreSQL Buildfarm is generously 
-provided by: 
-<a href="http://www.commandprompt.com">CommandPrompt, 
-The PostgreSQL Company</a>
-</p>
-</div><!-- wrapper -->
-</body>
+
+      </div><!-- main -->
+      <hr />
+      <p style="text-align: center;">
+       Hosting for the PostgreSQL Buildfarm is generously 
+       provided by: 
+       <a href="http://www.commandprompt.com">CommandPrompt, The PostgreSQL Company</a>
+      </p>
+    </div><!-- wrapper -->
+  </body>
 </html>
+
diff --git a/templates/bfwrapper.tt b/templates/bfwrapper.tt
deleted file mode 100644 (file)
index 75cd7a6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-    <title>PostgreSQL BuildFarm Status</title>
-    <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8"
- />
-    <style type="text/css"><!--
-    li#status a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 
-100% -20px; } 
-    li#status { background: url(/inc/b/l.png) no-repeat 0% -20px; }
-    --></style>
-</head>
-<body>
-<div id="wrapper">
-<div id="banner">
-<a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL Bui
-ldFarm" width="800" height="73" /></a>
-<div id="nav">
-<ul>
-    <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</
-a></li>
-    <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">St
-atus</a></li>
-    <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested"
->Members</a></li>
-    <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm"
->Register</a></li>
-    <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFo
-undry</a></li>
-    <li id="postgresql.org"><a href="http://www.postgresql.org">PostgreSQL.org</
-a></li>
-</ul>
-</div><!-- nav -->
-</div><!-- banner -->
-<div id="main">
-[% content %]
-</div><!-- main -->
-<hr />
-<p style="text-align: center;">
-Hosting for the PostgreSQL Buildfarm is generously 
-provided by: 
-<a href="http://www.commandprompt.com">CommandPrompt, 
-The PostgreSQL Company</a>
-</p>
-</div><!-- wrapper -->
-  </body>
-</html>
diff --git a/templates/dashboard.tt b/templates/dashboard.tt
deleted file mode 100644 (file)
index e7e7ee0..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-[%
- flag_imgs = {
-     perl = '/img/camel.png',
-     python = '/img/python.png',
-     debug = '/img/bug.png',
-     pam => '/img/pam.png',
-     cassert => '/img/cassert.png',
-     openssl => '/img/ssl_icon.gif',
-     nls => '/img/translateicon.gif',
-     krb5 => '/img/krb.gif',
-     tcl => '/img/tcl.png',
-     'thread-safety' => '/img/threads.gif',
-     'integer-datetimes' = '/img/days.png',
-     }
--%]
-[%-  BLOCK img ; 
-       IF flag == 'depend' or flag == 'gnu-ld' ; ; 
-       ELSIF flag_imgs.$flag ; 
-          FILTER collapse %]<img src="[% flag_imgs.$flag %]" 
-                               title="[% flag %]" alt="[% flag %]" 
-                               height="16" width="16" class="inline" align="bottom" />  
-       [%  END ;
-        END; 
-     END 
--%]
-[%- BLOCK cl %] class="[% SWITCH bgfor -%]
-  [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
-[%- END -%]
-
-<div id="main">
-    <h1>PostgreSQL BuildFarm Status</h1>
-    <p>
-      Shown here is the latest status of each farm member 
-      for each branch it has reported on in the last 30 days.
-    </p>
-    <p>
-       Use the farm member link for history of that member 
-       on the relevant branch.
-    </p>
-<table><tr><th class="head" rowspan="2">Legend</th>
-[% FOREACH flagset IN flag_imgs %]
-<td><img src="[% flagset.value %]" title="[% flagset.key %]" alt="[% flagset.key %]" height="16" width="16" class="inline"  align="center"/> =  [% flagset.key %]</td>
-[% IF loop.count == 5 %]</tr><tr>[% END %]
-[% END %]
-</tr></table>
-<br />
-    <table cellspacing="0">
-[% brch = "" %]
-[% FOREACH row IN statrows %]
-[% IF row.branch != brch ; brch = row.branch %]
-<tr><th class="head" colspan="4">Branch: [% brch %]</th></tr>
-<tr><th>Alias</th><th>System</th><th>Status</th><th>Flags</th></tr>
-[% END %]
-<tr [% PROCESS cl bgfor=row.stage %]>
-    <td><a 
-    href="show_history.pl?nm=[% row.sysname %]&amp;br=[% row.branch %]"
-    title="History"
-    >[% row.sysname %]</a></td>
-    <td><span class="opsys">[% row.operating_system %]
-            [% row.os_version %]</span> <span class="compiler">
-            [%- row.compiler %]
-            [% row.compiler_version %]</span> <span class="arch">
-            [%- row.architecture %]</span></td>
-    <td class="status">
-            [%- row.when_ago | replace('\s','&nbsp;') %]&nbsp;ago&nbsp;
-            [% row.stage -%]
-            <a href="show_log.pl?nm=
-               [%- row.sysname %]&amp;dt=
-               [%- row.snapshot | uri %]">
-                [%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
-
-    <td class="flags">[% FOREACH flag IN row.build_flags.split().sort() ; PROCESS img ; END %]</td>
-</tr>
-[% END %]
-    </table>
-</div>
-
index 27a5be1be7287ba284274e766faf6d2b308524b1..d0510e699b0e76d4ca921b5360f661d1e82cc88a 100644 (file)
@@ -1,78 +1,42 @@
 [%- BLOCK cl %] class="[% SWITCH bgfor -%]
   [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
 [%- END -%]
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-    <title>PostgreSQL BuildFarm History</title>
-       <link rel="icon" type="image/png" href="/elephant-icon.png" />
-    <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
-       <style type="text/css"><!--
-       li#status a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; } 
-       li#status { background: url(/inc/b/l.png) no-repeat 0% -20px; }
-       --></style>
-</head>
-<body class="history">
-<div id="wrapper">
-<div id="banner">
-<a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
-<div id="nav">
-<ul>
-    <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
-    <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
-    <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
-    <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
-    <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
-</ul>
-</div><!-- nav -->
-</div><!-- banner -->
-<div id="main">
+[% WRAPPER 'page.tt' 
+       title = 'PostgreSQL BuildFarm History'
+       bodyclass = 'history'
+       pagebutton = 'none'
+%]
 <h1>PostgreSQL BuildFarm Status History</h1>
-<table cellspacing="0">
+  <table cellspacing="0">
     <tr><th class="head" colspan="3">System Detail</th></tr>
     <tr class="member"><th>Farm member</th><td>[% member %]</td></tr>
     <tr><th>OS</th><td>[% statrows.0.operating_system %] [% statrows.0.os_version %]</td></tr>
-<!--    <tr><th>OS Version</th><td>[% statrows.0.os_version %]</td></tr> -->
     <tr><th>Compiler</th><td>[% statrows.0.compiler %] [% statrows.0.compiler_version %]</td></tr>
-<!--    <tr><th>Compiler Version</th><td>[% statrows.0.compiler_version %]</td></tr> -->
     <tr><th>Architecture</th><td>[% statrows.0.architecture %]</td></tr>
     <tr><th>Owner</th><td>[% statrows.0.owner_email %]</td></tr>
-    </table>
-    <h3>Branch: [% branch %][% IF statrows.size >= hm %] (last [% hm %] entries shown)[% END %]</h3>
+  </table>
+  <h3>Branch: [% branch %][% IF statrows.size >= hm %] (last [% hm %] entries shown)[% END %]</h3>
 [% BLOCK stdet %]
-<tr [% PROCESS cl bgfor=row.stage %]>
-    <td>[%- row.when_ago | replace('\s','&nbsp;') %]&nbsp;ago&nbsp;</td>
-    <td class="status">[% row.stage -%]</td>
-    <td class="status"><a href="show_log.pl?nm=
+    <tr [% PROCESS cl bgfor=row.stage %]>
+      <td>[%- row.when_ago | replace('\s','&nbsp;') %]&nbsp;ago&nbsp;</td>
+      <td class="status">[% row.stage -%]</td>
+      <td class="status"><a href="show_log.pl?nm=
                [%- row.sysname %]&amp;dt=
                [%- row.snapshot | uri %]">
                 [%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
 
-</tr>
+    </tr>
 [% END %]
 <table border="0"> <tr>
-[% FOREACH offset IN [0,1,2] %][% low = offset * statrows.size / 3 ; high = -1 + (offset + 1) * statrows.size / 3 %] 
-[% TRY %][% PERL %] 
-  use POSIX qw(floor); 
-  $stash->set(low => floor($stash->get('low'))); 
-  $stash->set(high => floor($stash->get('high'))); 
-[% END %][% CATCH %]<!-- [% error.info %] --> [% END %]
+  [% FOREACH offset IN [0,1,2] %][% low = offset * statrows.size / 3 ; high = -1 + (offset + 1) * statrows.size / 3 %] 
+    [% TRY %][% PERL %] 
+      use POSIX qw(floor); 
+      $stash->set(low => floor($stash->get('low'))); 
+      $stash->set(high => floor($stash->get('high'))); 
+    [% END %][% CATCH %]<!-- [% error.info %] --> [% END %]
     <td><table cellspacing="0">
-<!--      <tr><th colspan=3>low = [% low %], high = [% high %]</th></tr> -->
         [% FOREACH xrow IN statrows.slice(low,high) %][% PROCESS stdet row=xrow %][% END %]
     </table></td>
-[% END %]
+  [% END %]
 </table>
-    </div><!-- main -->
-<hr />
-<p style="text-align: center;">
-Hosting for the PostgreSQL Buildfarm is generously 
-provided by: 
-<a href="http://www.commandprompt.com">CommandPrompt, 
-The PostgreSQL Company</a>
-</p>
-    </div><!-- wrapper -->
-  </body>
-</html>
+[% END %]
diff --git a/templates/index.tt b/templates/index.tt
new file mode 100644 (file)
index 0000000..ad99339
--- /dev/null
@@ -0,0 +1,38 @@
+[%#
+
+       Use this template to generate the index page, with something like:
+
+               tpage index.tt > ../htdocs/index.html
+
+-%]
+[% WRAPPER 'page.tt' 
+       title = 'PostgreSQL BuildFarm'
+       bodyclass = 'none'
+       pagebutton = 'home'
+%]
+<!-- html generated from index.tt -->
+<p>
+The PostgreSQL build farm is a distributed system for automatically testing
+changes in the source code for PostgreSQL as they occur, on a wide variety
+of platforms. This server is the central repository for the results of those
+tests.
+</p>
+<p>
+To see the current status of tests on various branches, check the
+<a href="/cgi-bin/show_status.pl" title="Status Page">Status Page</a>.
+</p>
+<p>
+If you are interested in running a member of the build farm, then please visit
+the <a href="/cgi-bin/register-form.pl" title="Register">Registration Page</a>.
+We are particularly interested in unusual platforms or combinations of
+architecture, operating system and compiler.
+</p>
+<p>To see what is involved in running a buildfarm member, please 
+read <a href="http://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto">http://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto</a>.
+The client code can be found at the
+<a href="http://pgfoundry.org/projects/pgbuildfarm/">project page</a> at 
+<a href="http://pgfoundry.org/">PGFoundry</a>.
+</p>
+<p>The build farm software should run on all platforms that can support PostgreSQL.
+</p>
+[% END %]
index 291cbdb14e1dbae87908fe1c3a0002764ede585f..da255f2ffafe034c40c4905124bd944b0a734cf3 100644 (file)
@@ -8,35 +8,17 @@
        $stash->set( logcells => $logcells);
        $stash->set( logrows => $logrows ); 
 [% END -%]
+[% mytitle = BLOCK %]PostgreSQL BuildFarm | [% IF stage != 'OK' %]Log for system "[% system %]" failure on snapshot taken [% urldt ; ELSE %]Configuration summary for system "[% system %]" snapshot taken [% urldt ; END ; END -%]
 [%
         cvsurl = 'http://anoncvs.postgresql.org/cvsweb.cgi';
         giturl = scmurl || 'http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=';
 -%]
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-    <title>PostgreSQL BuildFarm | [% IF stage != 'OK' %]Log for system "[% system %]" failure on snapshot taken [% urldt ; ELSE %]Configuration summary for system "[% system %]" snapshot taken [% urldt ; END %]</title>
-    <link rel="icon" type="image/png" href="/elephant-icon.png" />
-    <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
-</head>
-<body>
-<div id="wrapper">
-<div id="banner">
-<a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
-<div id="nav">
-<ul>
-    <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
-    <li id="status"><a href="/cgi-bin/show_status.pl" title="Status Page">Status</a></li>
-    <li id="members"><a href="/cgi-bin/show_members.pl" title="Status Page">Members</a></li>
-    <li id="register"><a href="/cgi-bin/register-form.pl" title="Register">Register</a></li>
-    <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
-</ul>
-</div><!-- nav -->
-</div><!-- banner -->
-<div id="main">
-    <h1>PostgreSQL Build Farm Log</h1>
+[% WRAPPER 'page.tt' 
+       title = mytitle
+       bodyclass = 'none'
+       pagebutton = 'none'
+%]
+<h1>PostgreSQL Build Farm Log</h1>
 <h2>Details for system "[% system %]"[% IF stage != 'OK' %] failure at stage [% stage ; ELSE %], status 'OK'[% END %], snapshot taken [% urldt %]</h2>
 <table cellspacing="0">
     <tr>
@@ -118,14 +100,4 @@ not recorded
 <pre>
 [% log | html %]
 </pre>
-</div><!-- main -->
-<hr />
-<p style="text-align: center;">
-Hosting for the PostgreSQL Buildfarm is generously 
-provided by: 
-<a href="http://www.commandprompt.com">CommandPrompt, 
-The PostgreSQL Company</a>
-</p>
-</div><!-- wrapper -->
-</body>
-</html>
+[% END %]
index 7e737b43ecfec6fbd853fb258b0e52d5d9adfb8d..18bb907a9b0750e57202bfa19255c075c80ad579 100644 (file)
@@ -1,32 +1,8 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-       <title>PostgreSQL BuildFarm Members</title>
-       <link rel="icon" type="image/png" href="/elephant-icon.png" />
-       <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
-       <style type="text/css"><!--
-       li#members a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; } 
-       li#members { background: url(/inc/b/l.png) no-repeat 0% -20px; }
-       --></style>
-   </style>
-</head>
-<body class="members">
-<div id="wrapper">
-<div id="banner">
-<a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
-<div id="nav">
-<ul>
-    <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
-    <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
-    <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
-    <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
-    <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
-</ul>
-</div><!-- nav -->
-</div><!-- banner -->
-<div id="main">
+[% WRAPPER 'page.tt' 
+       title = 'PostgreSQL BuildFarm Members'
+       bodyclass = 'members'
+       pagebutton = 'members'
+%]
 <h1>PostgreSQL BuildFarm Members</h1>
     <p>Click branch links to see build history. Click the heading links to resort the list. Select members by checkbox and hit the button at the bottom to create a status custom filter.</p>
     <form name="filter" method="GET" action="/cgi-bin/show_status.pl">
     </table>
     <input type="submit" value="Make Filter" />
     </form>
-    </div><!-- main -->
-<hr />
-<p style="text-align: center;">
-Hosting for the PostgreSQL Buildfarm is generously 
-provided by: 
-<a href="http://www.commandprompt.com">CommandPrompt, 
-The PostgreSQL Company</a>
-</p>
-    </div><!-- wrapper -->
-  </body>
-</html>
-
-
-
-
-
-
-
-
+[% END %]
diff --git a/templates/page.tt b/templates/page.tt
new file mode 100644 (file)
index 0000000..f00da9b
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <title>[% title %]</title>
+    <link rel="icon" type="image/png" href="/elephant-icon.png" />
+    <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
+    <style type="text/css"><!--
+       li#[% pagebutton %] a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; } 
+       li#[% pagebutton %] { background: url(/inc/b/l.png) no-repeat 0% -20px; }
+    --></style>
+  </head>
+  <body class="[% bodyclass %]">
+    <div id="wrapper">
+      <div id="banner">
+        <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
+        <div id="nav">
+          <ul>
+           <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
+           <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
+           <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
+           <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
+           <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
+          </ul>
+        </div><!-- nav -->
+      </div><!-- banner -->
+      <div id="main">
+        [% content %]
+      </div><!-- main -->
+      <hr />
+      <p style="text-align: center;">
+       Hosting for the PostgreSQL Buildfarm is generously 
+       provided by: 
+       <a href="http://www.commandprompt.com">CommandPrompt, The PostgreSQL Company</a>
+      </p>
+    </div><!-- wrapper -->
+  </body>
+</html>
index 13c8a4d11b9c005c18a34ef9485ce6e7f4574b07..0f4f82b3e79878d8b2bffffa7a19dad0df5c2483 100644 (file)
@@ -1,31 +1,8 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-       <title>PostgreSQL BuildFarm Application</title>
-       <link rel="icon" type="image/png" href="/elephant-icon.png" />
-       <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
-       <style type="text/css"><!--
-       li#register a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; } 
-       li#register { background: url(/inc/b/l.png) no-repeat 0% -20px; }
-       --></style>
-</head>
-<body class="application">
-<div id="wrapper">
-<div id="banner">
-<a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
-<div id="nav">
-<ul>
-    <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
-    <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
-    <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
-    <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
-    <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
-</ul>
-</div><!-- nav -->
-</div><!-- banner -->
-<div id="main">
+[% WRAPPER 'page.tt' 
+       title = 'PostgreSQL BuildFarm Application'
+       bodyclass = 'application'
+       pagebutton = 'register'
+%]
 <h1>Application to join PostgreSQL BuildFarm</h1>
 
 <p>Here is a short description of what is required to join the buildfarm successfully. Please read it carefully
@@ -48,10 +25,6 @@ before submitting this form.</p>
 <li> when you receive credentials, put them in the config file, and schedule regular builds (without those flags) 
      for the branches you want to support - which should be at least HEAD and the most recent stable branch.</li>
 </ul>
-
-<p>There is also some extra information in this 
-<a href="http://www.onlamp.com/pub/a/onlamp/2005/02/24/pg_buildfarm.html">article about buildfarm</a> on the O'Reilly network.</p>
-
 <hr />
 
 <p>Please complete all items.</p>
@@ -96,16 +69,4 @@ Systems is "Fedora Core" and the version is "4".</p>
 </tr>
 </table>
 </form>
-</div><!-- main -->
-<hr />
-<p style="text-align: center;">
-Hosting for the PostgreSQL Buildfarm is generously 
-provided by: 
-<a href="http://www.commandprompt.com">CommandPrompt, 
-The PostgreSQL Company</a>
-</p>
-</div><!-- wrapper -->
-</body>
-</html>
-
-
+[% END %]
diff --git a/templates/register-incomplete.tt b/templates/register-incomplete.tt
new file mode 100644 (file)
index 0000000..bc73f41
--- /dev/null
@@ -0,0 +1,9 @@
+[% WRAPPER 'page.tt' 
+    title = 'PostgreSQL BuildFarm Application'
+    bodyclass = 'application'
+    pagebutton = 'none'
+%]
+<p>You need to complete all the form items. 
+<a href="/cgi-bin/register-form.pl">Please click here to try again.</a>
+</p>
+[% END %]
diff --git a/templates/register-ok.tt b/templates/register-ok.tt
new file mode 100644 (file)
index 0000000..fdfea96
--- /dev/null
@@ -0,0 +1,8 @@
+[% WRAPPER 'page.tt' 
+    title = 'PostgreSQL BuildFarm Application'
+    bodyclass = 'application'
+    pagebutton = 'none'
+%]
+<h1>PostgreSQL BuildFarm Application received</h1>\
+<p>Thank you. You should hear from us shortly.</p>
+[% END %]
index 23fcff2ff4209dd1ef1897766aecf61117924588..32a17d6fde49552e98947f85a5e2c0a24b4667d3 100644 (file)
 [%- BLOCK cl %] class="[% SWITCH bgfor.replace('-.*','') -%]
   [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
 [%- END -%]
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-    <title>PostgreSQL BuildFarm Status</title>
-<link rel="icon" type="image/png" href="/elephant-icon.png" /> 
-    <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
-       <style type="text/css"><!--
-       li#status a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; } 
-       li#status { background: url(/inc/b/l.png) no-repeat 0% -20px; }
-       --></style>
-</head>
-<body>
-<div id="wrapper">
-<div id="banner">
-<a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
-<div id="nav">
-<ul>
-    <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
-    <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
-    <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
-    <li id="register"><a href="/cgi-bin/register-form.pl" title="Join PostgreSQL BuildFarm">Register</a></li>
-    <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
-    <li id="postgresql.org"><a href="http://www.postgresql.org">PostgreSQL.org</a></li>
-</ul>
-</div><!-- nav -->
-</div><!-- banner -->
-<div id="main">
+[% WRAPPER 'page.tt' 
+       title = 'PostgreSQL BuildFarm Status'
+       bodyclass = 'none'
+       pagebutton = 'status'
+%]
     <h1>PostgreSQL BuildFarm Status</h1>
     <p>
       Shown here is the latest status of each farm member 
 </tr>
 [% END %]
     </table>
-</div><!-- main -->
-<hr />
-<p style="text-align: center;">
-The PostgreSQL Buildfarm website is provided by: 
-<a href="http://www.commandprompt.com">CommandPrompt, 
-The PostgreSQL Company</a> <br />
-The PostgreSQL community makes it work!
-</p>
-</div><!-- wrapper -->
-  </body>
-</html>
-
-
-
-
-
-
-
-
+[% END %]