From 3837fd6e5a90779f13b66265d6c7489d9aa37d2d Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 14 Dec 2012 16:56:41 -0800 Subject: [PATCH] add templates for pkgreport.cgi --- cgi/pkgreport.cgi | 96 +++++++++++++----------------- templates/en_US/cgi/pkgreport.tmpl | 31 ++++++++++ 2 files changed, 73 insertions(+), 54 deletions(-) create mode 100644 templates/en_US/cgi/pkgreport.tmpl diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index d29c3abc..40982ef7 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -314,6 +314,15 @@ for my $package (# For binary packages, add the binary package } +my $pkg = $param{package} if defined $param{package}; +my $src = $param{src} if defined $param{src}; + +# if this is a psuedopackage, then dist makes no sense +my $pseudodesc = getpseudodesc(); +if (defined $pseudodesc and defined $pkg and exists $pseudodesc->{$pkg}) { + delete $param{dist}; +} + # walk through the keys and make the right get_bugs query. my $form_option_variables = {}; @@ -440,71 +449,50 @@ my $result = pkg_htmlizebugs(bugs => \@bugs, print "Content-Type: text/html; charset=utf-8\n\n"; -print "\n"; -print "\n" . - "$title -- $gProject$Archived $gBug report logs\n" . - qq() . - "\n" . - '' . - "\n"; -print qq(
\n); -print "

" . "$gProject$Archived $gBug report logs: $title" . - "

\n"; - -my $showresult = 1; - -my $pkg = $param{package} if defined $param{package}; -my $src = $param{src} if defined $param{src}; - -my $pseudodesc = getpseudodesc(); -if (defined $pseudodesc and defined $pkg and exists $pseudodesc->{$pkg}) { - delete $param{dist}; -} - # output information about the packages -for my $package (make_list($param{package}||[])) { - print generate_package_info(binary => 1, - package => $package, - options => \%param, - bugs => \@bugs, - ); -} -for my $package (make_list($param{src}||[])) { - print generate_package_info(binary => 0, - package => $package, - options => \%param, - bugs => \@bugs, - ); -} + +my %variables; if (exists $param{maint} or exists $param{maintenc}) { - print "

Note that maintainers may use different Maintainer fields for\n"; - print "different packages, so there may be other reports filed under\n"; - print "different addresses.\n"; + $variables{maint_note} = 1; } if (exists $param{submitter}) { - print "

Note that people may use different email accounts for\n"; - print "different bugs, so there may be other reports filed under\n"; - print "different addresses.\n"; + $variables{submitter_note} = 1; } +$variables{result} = $result; +$variables{option_form} = + option_form(template => 'cgi/pkgreport_options', + param => \%param, + form_options => $form_options, + variables => $form_option_variables, + ); -print $result; - -print fill_in_template(template=>'cgi/pkgreport_javascript'); +$variables{package_info} = ''; -print qq(

Options

\n); +for my $package (make_list($param{package}||[])) { + $variables{package_info} .= + generate_package_info(binary => 1, + package => $package, + options => \%param, + bugs => \@bugs, + ); +} -print option_form(template => 'cgi/pkgreport_options', - param => \%param, - form_options => $form_options, - variables => $form_option_variables, - ); +for my $package (make_list($param{src}||[])) { + $variables{package_info} .= + generate_package_info(binary => 0, + package => $package, + options => \%param, + bugs => \@bugs, + ); +} -print "
\n"; -print fill_in_template(template=>'html/html_tail', +print fill_in_template(template=>'cgi/pkgreport', + variables => {%variables, + param => \%param, + html_escape => \&Debbugs::CGI::html_escape, + }, hole_var => {'&strftime' => \&POSIX::strftime, }, ); -print "\n"; - diff --git a/templates/en_US/cgi/pkgreport.tmpl b/templates/en_US/cgi/pkgreport.tmpl new file mode 100644 index 00000000..dc901d9b --- /dev/null +++ b/templates/en_US/cgi/pkgreport.tmpl @@ -0,0 +1,31 @@ +{include(q(html/pre_title))}{$title} -- {html_escape($config{project})} {html_escape($config{bug})} report logs{include(q(html/post_title.tmpl))} + + +
+

{$title} -- {html_escape($config{project})} {html_escape($config{bug})} report logs

+{ $package_info } +{ my $output = ''; +if ($maint_note) { + $output .= <Note that maintainers may use different Maintainer fields for +different packages, so there may be other reports filed under +different addresses.

+END +} +if ($submitter_note) { + $output .= <Note that people may use different email accounts for +different bugs, so there may be other reports filed under +different addresses.

+END +} +$output; +} +{ $result } +{include(q(cgi/pkgreport_javascript))} +

Options

+{ $option_form } +
+{include(q(html/html_tail))} + + -- 2.39.5