<%args>
        $report
        %failures => {}
</%args>
<%method meta_row>
  <%args>
        $name
        $value
  </%args>
% if ($value) {
<tr>
        <th><% $name %>:</th>
        <td>
%       if ($name =~ /url$/) {
%           my @urls = split(qr/\s+/, $value);
%           foreach my $url (@urls) {
                <a href="<% $url %>"><% $url %></a>
%           }
%       } else {
            <% $value %>
%       }
        </td>
</tr>
% }
</%method>

%          # this enumeration is a bit lame. anyway: copy the list from Tapper::TAP::Harness.@SECTION_HEADER_KEYS_GENERAL.
%          my @meta_cols = qw/ram cpuinfo bios lspci uname osname uptime language-description
%                             flags kernel changeset description
%                             xen-version xen-changeset xen-dom0-kernel xen-base-os-description
%                             xen-guest-description xen-guest-test xen-guest-start xen-guest-flags
%                             kvm-module-version kvm-userspace-version kvm-kernel
%                             kvm-base-os-description kvm-guest-description
%                             kvm-guest-test kvm-guest-start kvm-guest-flags
%                             simnow-version
%                             simnow-svn-version
%                             simnow-device-interface-version
%                             simnow-svn-repository
%                             simnow-bsd-file
%                             simnow-image-file
%                             ticket-url wiki-url planning-id moreinfo-url
%                             tags
%                            /;
%
% my $reportgrouptestrun = $report->reportgrouptestrun;
% my @reportlist = ($report);
% if ($reportgrouptestrun) {
%     @reportlist = $reportgrouptestrun->groupreports->all;
% }

% if (keys %failures) {
<h4>Issue Summary</h4>
    <table class="issuesummary">
      <tbody>
%   foreach my $key (sort keys %failures) {
%     my $report_name = $failures{$key}{name};
%     if (my @report_failures = @{$failures{$key}{failures}}) {
        <tr>
          <td><a href="/tapper/reports/id/<% $key %>">
%         if ($key eq $report->id) {
            <strong>
%         }
            <% $key %>
%         if ($key eq $report->id) {
            </strong>
%         }
          </a></td>
          <th colspan="2"><u><% $report_name %></u></th>
        </tr>
%       foreach my $failure (@report_failures) {
        <tr>
          <td/>
          <td/>
          <td>not ok <% $failure->{number} %> <strong><% $failure->{description} %></strong></td>
        </tr>
%       } # foreach failure
%     } # if @eport_failures
%   } # foreach keys failures
      </tbody>
    </table>
% } # if keys failures

% if (grep { $_->some_meta_available } @reportlist) {
<h4>Test Execution Context</h4>

%  foreach my $r ( @reportlist) {
%   my $sections = $r->reportsections;

%   if ($r->some_meta_available) {
      <h5><b><% $r->suite ? $r->suite->name : 'unknown suite' %></b> (r<a href="<% $r->id %>"><% $r->id %></a>)</h5>
      <table class="reportsectionmeta">
%     while (my $section = $sections->next) {

%        if ($section->some_meta_available) {

        <tr><td colspan="2"><h5>&nbsp;&nbsp;<% $section->name %></h5></td></tr>
%          my %cols = $section->get_columns;
%           foreach (map { s/-/_/g; $_ } @meta_cols) {
                <& SELF:meta_row, name => $_ , value => $cols{$_} &>
%           }
%        } # if $section->some_meta_available
%     } # while $sections->next
      </table>
%   } # if $r->some_meta_available
%  }
% } # if grep some_meta_available

%# Local Variables:
%# buffer-file-coding-system: utf-8
%# End:
