--- /dev/null
+[%
+ USE DBI;
+ USE WebSession;
+ USE utils = WebUtils;
+ USE testdoc = XML::LibXML(config_xml);
+
+ userid = 1;
+
+ dbname = testdoc.findvalue('/reporter/setup/database/name');
+ dbhost = testdoc.findvalue('/reporter/setup/database/host');
+ d_u = testdoc.findvalue('/reporter/setup/database/user');
+ d_p = testdoc.findvalue('/reporter/setup/database/password');
+
+ dsn = "dbi:Pg:dbname=" _ dbname _';host=' _ dbhost;
+
+ '<!-- ' _ dsn _ ', ' _ d_u _ ', ' _ d_p _ ' -->';
+
+ DBI.connect(dsn,d_u,d_p);
+%]
+
+<html>
+ <body>
+ <h1>Reports: yay!</h1>
+ [% PROCESS PRINT_STAGE1 %]
+ </body>
+</html>
+
+
+
+
+[% BLOCK PRINT_STAGE1 %]
+ <table border=1>
+[% FOR s1 IN DBI.query("select * from reporter.stage1 where pub is true;");
+ USE doc = XML::LibXML(s1.filename); %]
+
+ <tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ [%doc.findvalue('/reporter/report/@name')%]
+ </td>
+ <td>
+ Description:
+ </td>
+ <td>
+ [%doc.findvalue('/reporter/report/description')%]
+ </td>
+ <td>
+ Visible Stage2 reports:
+ </td>
+ <td>
+ [% q = 'select count(*) as x from reporter.stage2 ' _
+ 'where pub is true or owner = ' _ userid;
+ FOR r IN DBI.query(q);
+ r.x;
+ END %]
+ </td>
+ </tr>
+
+[% END %]
+ </table>
+[% END %]