a few style / layout improvements
authorChris Butler <chrisb@debian.org>
Tue, 5 Oct 2010 08:09:48 +0000 (09:09 +0100)
committerChris Butler <chrisb@debian.org>
Tue, 5 Oct 2010 08:11:06 +0000 (09:11 +0100)
templates/footer
templates/result
tools/mh-xmltv-testlog2html
xmltv-tester.css

index b6e5783..8c7d886 100644 (file)
@@ -1,3 +1,3 @@
-<div class="footer">
+<div id="ft">
        XMLTV validator, originally by Mattias Holmlund, now maintained by Chris Butler. <a href="http://git.crustynet.org.uk/xmltv-tester.git/">Source available in my git repository</a>.
 </div>
index 8268fa1..32fc2c2 100644 (file)
@@ -1,60 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+
 <html>
     <head>
                <title>XMLTV [% title %]</title>
-               <link rel="stylesheet" type="text/css" href="/~xmltv-tester/xmltv-tester.css" />
+               <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.1/build/grids/grids-min.css">
+               <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.1/build/base/base-min.css">
+               <link rel="stylesheet" type="text/css" href="/~xmltv-tester/xmltv-tester.css?1" />
     </head>
 <body>
+       <div id="doc3">
 
-<h1>XMLTV Test Report</h1>
-<strong>Source:</strong> [% title %]<br>
-<strong>ChangeLog:</strong> <a href="ChangeLog">Last 7 days</a><br>
-<strong>Build log:</strong> <a href="build.log">build.log</a><br>
-[% INCLUDE header  base="../" %]
-
-<h1>Tested</h1>
-<table>
-[% FOREACH grabber = summary.keys %] 
-  <tr>
-    <td><a href="#[% grabber %]">[% grabber %]</a></td>
-    <td>
-    [% FOREACH error = summary.$grabber %]
-      <a href="http://wiki.xmltv.org/index.php/XmltvTestCodes#[% error %]">[% error %]</a> 
-    [% END %]
-    </td>
-  </tr>
-[% END %]
-</table>
+               <div id="hd">
+                       <h1>XMLTV Test Report</h1>
+                       <strong>Source:</strong> [% title %]<br>
+                       <strong>ChangeLog:</strong> <a href="ChangeLog">Last 7 days</a><br>
+                       <strong>Build log:</strong> <a href="build.log">build.log</a><br>
+                       [% INCLUDE header  base="../" %]
+               </div>
 
-<h1>Not tested</h1>
-<table>
-[% FOREACH grabber = nottested.keys %] 
-  <tr>
-    <td>[% grabber %]</td>
-    <td>
-    [% FOREACH error = nottested.$grabber %]
-      <a href="http://wiki.xmltv.org/index.php/XmltvTestCodes#[% error %]">[% error %]</a> 
-    [% END %]
-    </td>
-  </tr>
-[% END %]
-</table>
+               <div id="bd">
+                       <div class="yui-g">
+                               <div class="yui-u first">
+                                       <h1>Tested</h1>
+                                       <table>
+                                       [% FOREACH grabber = summary.keys %] 
+                                         <tr>
+                                               <th scope="row"><a href="#[% grabber %]">[% grabber %]</a></td>
+                                               <td class="[% IF !summary.$grabber.ok %]n[% END %]ok">
+                                               [% FOREACH error = summary.$grabber.errors %]
+                                                       [% IF error == 'ok' %]
+                                                               [% error %]
+                                                       [% ELSE %]
+                                                               <a href="http://wiki.xmltv.org/index.php/XmltvTestCodes#[% error %]">[% error %]</a> 
+                                                       [% END %]
+                                               [% END %]
+                                               </td>
+                                         </tr>
+                                       [% END %]
+                                       </table>
+                               </div>
+                               <div class="yui-u">
+                                       <h1>Not tested</h1>
+                                       <table>
+                                       [% FOREACH grabber = nottested.keys %] 
+                                         <tr>
+                                               <th scope="row">[% grabber %]</td>
+                                               <td>
+                                               [% FOREACH error = nottested.$grabber %]
+                                                 <a href="http://wiki.xmltv.org/index.php/XmltvTestCodes#[% error %]">[% error %]</a> 
+                                               [% END %]
+                                               </td>
+                                         </tr>
+                                       [% END %]
+                                       </table>
+                               </div>
+                       </div>
 
-<h1>Detailed result</h1>
+                       <h1>Detailed result</h1>
 
-[% FOREACH grabber = detailed.keys %] 
-<strong><a name="[% grabber %]">Testing [% grabber %]</a></strong><br>
-  [% FOREACH line = detailed.$grabber %]
-    [% PERL %]
-      my $a = "[% line %]";
-      $a =~ s/\b(t_[-a-z0-9_\.]+)([a-z]{3})/ 
-             $2 eq 'xml' ? "$1$2" : "<a href=\"$1$2\">$1$2<\/a>"/ge;
-      print $a;
-    [% END %]
-    <br>
-  [% END %]
-[% END %]
+                       [% FOREACH grabber = detailed.keys %] 
+                       <strong><a name="[% grabber %]">Testing [% grabber %]</a></strong><br>
+                         [% FOREACH line = detailed.$grabber %]
+                               [% PERL %]
+                                 my $a = "[% line %]";
+                                 $a =~ s/\b(t_[-a-z0-9_\.]+)([a-z]{3})/ 
+                                                $2 eq 'xml' ? "$1$2" : "<a href=\"$1$2\">$1$2<\/a>"/ge;
+                                 print $a;
+                               [% END %]
+                               <br>
+                         [% END %]
+                       [% END %]
+               </div>
 
-[% INCLUDE "footer" %]
+               [% INCLUDE "footer" %]
+       </div>
 </body>
 </html>
 
index 8a4a321..6d06f30 100755 (executable)
@@ -51,7 +51,7 @@ while( $lines[$i] =~ /^(tv_grab_\S+)\s+(.*?)\s*$/ ) {
     my $grabber = $1;
     my @codes = split( /,\s*/, $2 );
     $results->{$grabber} = join( ",", @codes );
-    $data->{summary}->{$grabber} = [ @codes ];
+    $data->{summary}->{$grabber} = { errors => [ @codes ], ok => (length @codes == 1 && $codes[0] eq 'ok') };
     $i++;
 }
 
index bcc106d..13ca04b 100644 (file)
@@ -1,14 +1,24 @@
 thead { 
        font-weight: bold;
 }
-td {
+td,th {
        background-color: #ff8;
-       text-align: center 
+       text-align: center;
+       border: 0;
 }
 td.nok {
        background-color: #f88;
 }
 td.ok  { 
        background-color: #8f8;
-       text-align: center 
+       text-align: center;
+}
+#ft, .footer {
+       margin-top: 1em;
+       border-top: 1px black solid;
+       background-color: #ccc;
+       padding: 0.25em;
+}
+#ft a, .footer a {
+       float: right;
 }