my $ml = htmlsanit( $c{ListAddress} );
+my @all_bugs = Bugs::Bug->listall($dbh);
+
+my @index;
+my $lists;
+
+sub buglist ($$) {
+ my $open = shift;
+ my $sev = shift;
+
+ my @bugs =
+ grep { $_->{open} == $open and $_->{severity} eq $sev } @all_bugs;
+
+ return "" unless @bugs;
+
+ sub bug($) {
+ return (
+ buglink( $_, "#" . $_->{id} ) . " " . buglink( $_, $_->{title} ) );
+ }
+
+ my $title = ( $open ? "Open" : "Closed" ) . " $sev bugs";
+ my $anchor = ( $open ? "open" : "closed" ) . "_${sev}_bugs";
+ push @index,
+ li( a( { -href => "#$anchor" }, $title . " (" . @bugs . " bugs)" ) );
+ $lists .=
+ h2( { -class => "buglistsect" }, a( { -name => $anchor }, $title ) )
+ . "\n";
+
+ $lists .=
+ ul( li( [ map { bug($_) } sort { $a->{id} cmp $b->{id} } @bugs, ] ) );
+ $lists .= "\n";
+}
+
+foreach my $open ( 1, 0 ) {
+ foreach my $sev ( @{ $c{SeverityLevels} } ) { buglist( $open, $sev ); }
+}
+
print header;
print start_html(
-style => { 'src' => $c{StyleSheet} }
) . "\n";
+print h1( $c{TrackerName} );
+
print p(
[
- "This is the $ml bug tracker.",
- "For information on how to report a bug please see "
+ "This is the bug tracker for $ml.",
+ "You cannot submit bugs here. "
+ . "For information on how to report a bug please see "
. a( { -href => $c{ReportingURL} }, "this link" )
]
) . "\n";
-print hr;
+print hr . "\n";
+
+print ul (@index);
-my @bugs = Bugs::Bug->listall($dbh);
+print hr . "\n";
-print table(
- Tr(
- [
- th( [ 'Bug #', 'Title' ] ),
- map { td( [ $_->{id}, buglink($_) ] ) } @bugs,
- ],
- )
-);
+print $lists;
print end_html;
@{$c{ControlAllow}} = qw/ijc@hellion.org.uk foo@example.com/;
-@{$c{SeverityLevels}} = qw/wishlist normal critical blocker/;
+# Severity levels, in decending order of criticality
+@{$c{SeverityLevels}} = qw/blocker critical normal wishlist/;
$c{DefaultSeverity} = "normal";
.bugmetadata p
{
- font-family: sans-serif;
- font-size: 110%;
- margin-bottom: 0px
+ font-family: sans-serif;
+ font-size: 110%;
+ margin-bottom: 0px
}
.bugmetadata p + p
{
- margin: 0;
- margin-top: 0px;
- border: 0;
+ margin: 0;
+ margin-top: 0px;
+ border: 0;
+}
+
+h2.buglistsect
+{
+ font-family: sans-serif;
+ background-color: #f0f0f0;
+ color: #3c3c3c;
+ border: #a7a7a7 1px solid;
+ padding: 10px;
}