From: ajt <> Date: Fri, 17 Nov 2000 11:03:15 +0000 (-0800) Subject: [project @ 2000-11-17 03:03:15 by ajt] X-Git-Tag: release/2.6.0~1177 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ba7768b33d150bd8e355ff5d35173005ed32c836;p=debbugs.git [project @ 2000-11-17 03:03:15 by ajt] Make the pkgindex display prettier --- diff --git a/cgi/common.pl b/cgi/common.pl index 7786b9c..ae8cc17 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -123,9 +123,17 @@ sub htmlindexentrystatus { return $result; } +sub submitterurl { + my $ref = shift; + my $params = "submitter=" . emailfromrfc822($ref); + $params .= "&archive=yes" if ($common_archive); + $params .= "&repeatmerged=yes" if ($common_repeatmerged); + return $debbugs::gCGIDomain . "pkgreport.cgi" . "?" . $params; +} + sub mainturl { my $ref = shift; - my $params = "maintenc=" . maintencoded($ref); + my $params = "maint=" . emailfromrfc822($ref); $params .= "&archive=yes" if ($common_archive); $params .= "&repeatmerged=yes" if ($common_repeatmerged); return $debbugs::gCGIDomain . "pkgreport.cgi" . "?" . $params; @@ -345,6 +353,13 @@ sub pkgbugsindex { return %descstr; } +sub emailfromrfc822 { + my $email = shift; + $email =~ s/\s*\(.*\)\s*//; + $email = $1 if ($email =~ m/<(.*)>/); + return $email; +} + sub maintencoded { my $input = shift; my $encoded = ''; diff --git a/cgi/pkgindex.cgi b/cgi/pkgindex.cgi index 292c237..74ec98a 100755 --- a/cgi/pkgindex.cgi +++ b/cgi/pkgindex.cgi @@ -49,29 +49,54 @@ set_option("archive", $archive); my %count; my $tag; my $note; +my $linksub; if ($indexon eq "pkg") { $tag = "package"; %count = countbugs(sub {my %d=@_; return $d{"pkg"}}); $note = "

Note that with multi-binary packages there may be other\n"; $note .= "reports filed under the different binary package names.

\n"; + $linksub = sub { + my $pkg = shift; + sprintf('%s ' + . '(maintained by %s', + pkgurl($pkg), + htmlsanit($pkg), + mainturl($maintainers{$pkg}), + htmlsanit($maintainers{$pkg})); + }; } elsif ($indexon eq "maint") { $tag = "maintainer"; - %count = countbugs(sub {my %d=@_; my $me; - $me = $maintainers{$d{"pkg"}} || ""; - $me =~ s/\s*\(.*\)\s*//; - $me = $1 if ($me =~ m/<(.*)>/); - return $me; + %count = countbugs(sub {my %d=@_; + return emailfromrfc822($maintainers{$d{"pkg"}} || ""); }); $note = "

Note that maintainers may use different Maintainer fields for\n"; $note .= "different packages, so there may be other reports filed under\n"; $note .= "different addresses.

\n"; + $linksub = sub { + my $maint = shift; my $maintfull = $maint; + foreach my $x (values %maintainers) { + if (emailfromrfc822($x) eq $maint) { + $maintfull = $x; last; + } + } + sprintf('%s', + mainturl($maint), + htmlsanit($maintfull)); + }; } elsif ($indexon eq "submitter") { $tag = "submitter"; - %count = countbugs(sub {my %d=@_; my $se; - ($se = $d{"submitter"} || "") =~ s/\s*\(.*\)\s*//; - $se = $1 if ($se =~ m/<(.*)>/); - return $se; + my %fullname = (); + %count = countbugs(sub {my %d=@_; my $f = $d{"submitter"} || ""; + my $em = emailfromrfc822($f); + $fullname{$em} = $f if (!defined $fullname{$em}); + return $em; }); + $linksub = sub { + my $sub = shift; + sprintf('%s', + submitterurl($sub), + htmlsanit($fullname{$sub})); + }; $note = "

Note that people may use different email accounts for\n"; $note .= "different bugs, so there may be other reports filed under\n"; $note .= "different addresses.

\n"; @@ -79,10 +104,7 @@ if ($indexon eq "pkg") { my $result = "\n";