-print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
-print "<HTML><HEAD>\n" .
- "<TITLE>$debbugs::gProject$Archived $debbugs::gBug reports by $tag</TITLE>\n" .
- "</HEAD>\n" .
- '<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080">' .
- "\n";
-print "<H1>" . "$debbugs::gProject$Archived $debbugs::gBug report logs by $tag" .
- "</H1>\n";
-
-print $note;
-print <<END;
-<form>
-<input type="hidden" name="skip" value="$param{skip}">
-<input type="hidden" name="max_results" value="$param{max_results}">
-<input type="hidden" name="indexon" value="$param{indexon}">
-<input type="hidden" name="repeatmerged" value="$param{repeatmerged}">
-<input type="hidden" name="archive" value="$param{archive}">
-<input type="hidden" name="sortby" value="$param{sortby}">
-END
-if (defined $param{first}) {
- print qq(<input type="hidden" name="first" value="$param{first}">\n);
-}
-else {
- print q(<p>);
- if ($param{skip} > 0) {
- print q(<input type="submit" name="prev" value="Prev">);
- }
- if (keys %count > ($param{skip} + $param{max_results})) {
- print q(<input type="submit" name="next" value="Next">);
- }
- print qq(</p>\n);
-}
-print $result;
-
-print "<hr>\n";
-print "<p>$tail_html";
+print fill_in_template(template=>'cgi/pkgindex.tmpl',
+ variables => {count => \%count,
+ param => \%param,
+ result => $result,
+ html_escape => \&Debbugs::CGI::html_escape,
+ archived => $Archived,
+ note => $note,
+ tag => $tag,
+ },
+ hole_var => {'&strftime' => \&POSIX::strftime,
+ },
+ );