my %content = ( subsections => [], suite => $s,
lang => $lang, charset => $charset,
- suites => \@SUITES );
+ used_langs => \@LANGUAGES, suites => \@SUITES );
$content{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
$content{make_url} = sub { return &Packages::CGI::make_url(@_) };
# needed to work around the limitations of the the FILTER syntax
open $pages{$key}{$lang}{index}{fh}, '>', "$wwwdir/$key/index.$lang.html.new"
or die "can't open index file for output: $!";
print {$pages{$key}{$lang}{index}{fh}} $template->page( 'suite_index', \%content );
- print {$pages{$key}{$lang}{index}{fh}} $template->trailer( 'index', $lang, \@LANGUAGES );
close $pages{$key}{$lang}{index}{fh} or
warn "can't close index file $wwwdir/$key/index.$lang.html.new: $!";
rename( "$wwwdir/$key/index.$lang.html.new",
open $pages{$key}{$lang}{source_index}{fh}, '>', "$wwwdir/source/$key/index.$lang.html.new"
or die "can't open index file for output: $!";
print {$pages{$key}{$lang}{source_index}{fh}} $template->page( 'suite_index', \%content );
- print {$pages{$key}{$lang}{source_index}{fh}} $template->trailer( 'index', $lang, \@LANGUAGES );
close $pages{$key}{$lang}{source_index}{fh} or
warn "can't close index file $wwwdir/source/$key/index.$lang.html.new: $!";
rename( "$wwwdir/source/$key/index.$lang.html.new",
$content{string2id} = sub { return &Packages::CGI::string2id(@_) };
print TAGLST $template->page( 'tag_index', \%content );
-print TAGLST $template->trailer();
close TAGLST or warn "Couldn't close tag list: $!";
rename( "$wwwdir/debtags.en.html.new",
push @components, 'index' if @components && $path =~ m,/$,;
- my %LANGUAGES = map { $_ => 1 } @LANGUAGES;
- if (@components > 0 and $LANGUAGES{$components[0]}) {
+ my %LANGUAGES = map { $_ => 1 } @all_langs;
+ if (@components > 0 and $LANGUAGES{$components[0]}
+ and !$input->param('lang')) {
$input->param( 'lang', shift(@components) );
}
if (@components > 0 and $components[0] eq 'source') {
#use Data::Dumper;
#print '<pre>'.Dumper(\%ENV, \%page_content, get_all_messages()).'</pre>';
print $template->page( $what_to_do, { %page_content, %{ get_all_messages() } } );
- my $tet1 = new Benchmark;
- my $tetd = timediff($tet1, $tet0);
- print $template->trailer( undef, undef, undef, $tetd );
} elsif ($Packages::CGI::http_code && $Packages::CGI::http_code !~ /^2\d\d/) {
print $input->header( -charset => $charset, -status => $Packages::CGI::http_code );
} else {
# so no format support here
print $input->header( -charset => $charset );
print $template->error_page( get_all_messages() );
- print $template->trailer();;
}
my $trans_desc = $desctrans{$desc_md5};
if ($trans_desc) {
my %trans_desc = split /\000|\001/, $trans_desc;
+ $contents{used_langs} = ['en', sort keys %trans_desc];
debug( "TRANSLATIONS: ".join(" ",keys %trans_desc), 2)
if DEBUG;
while (my ($l, $d) = each %trans_desc) {
%$options,
} ) or fatal_error( sprintf( _g( "Initialization of Template Engine failed: %s" ), $Template::ERROR ) );
$self->{format} = $format;
+ $self->{vars} = $vars;
return $self;
}
#use Data::Dumper;
#die Dumper($self, $action, $page_content);
+ $page_content->{used_langs} ||= [ 'en' ];
+ $page_content->{langs} = languages( $page_content->{lang}
+ || $self->{vars}{lang} || 'en',
+ @{$page_content->{used_langs}} );
my $txt;
$self->process("$self->{format}/$action.tmpl", $page_content, \$txt)
return $txt;
}
-sub trailer {
- my ($self, $NAME, $LANG, $USED_LANGS, $timediff) = @_;
-
- my $langs = languages( $LANG, @$USED_LANGS );
-
- my $txt;
- $self->process("$self->{format}/foot.tmpl", { langs => $langs, name => $NAME, benchmark => $timediff ? timestr($timediff) : '' }, \$txt)
- or die sprintf( "template error: %s", $self->error ); # too late for reporting on-line
-
- return $txt;
-}
-
sub languages {
my ( $lang, @used_langs ) = @_;
<tr><th>SHA1 checksum</th> <td><tt>[% sha1 || 'Not Available' %]</tt></td>
<tr><th>SHA256 checksum</th> <td><tt>[% sha256 || 'Not Available' %]</tt></td>
</table>
+
+[%- PROCESS 'html/foot.tmpl' -%]
title_tag = 'Error'
page_title = 'Error'
-%]
+
+[%- PROCESS 'html/foot.tmpl' -%]
<p>This page is also available in the following languages:</p>
<p class="navpara">
[% FOREACH langs %]
-<a href="[% "$name?lang=$lang" %]" title="[% tooltip %]" hreflang="[% lang %]" lang="[% lang %]" rel="alternate">[% selfname %]
+<a href="[% "$page_name?lang=$lang" %]" title="[% tooltip %]" hreflang="[% lang %]" lang="[% lang %]" rel="alternate">[% selfname %]
[%- IF transliteration %] ([% transliteration %])[% END %]</a>
[% END %]
</p>
[% '</dl>' IF loop.last %]
[% END %]
+
+[%- PROCESS 'html/foot.tmpl' -%]
[%- END -%]
[% ', ' UNLESS loop.last %]
[% END %]
-</p>
\ No newline at end of file
+</p>
+
+[%- PROCESS 'html/foot.tmpl' -%]
[% END %]
</div>
+
+[%- PROCESS 'html/foot.tmpl' -%]
<p id="psearchnoresult">Sorry, your search gave no results</p>
[% END %]
+
+[%- PROCESS 'html/foot.tmpl' -%]
<script type="text/javascript">init_tab_list("ptablist")</script>
+[%- PROCESS 'html/foot.tmpl' -%]
<a href="allpackages" title="List of all [% "source " IF source %]packages">All [% "source " IF source %]packages</a><br>
(<a href="allpackages?format=txt.gz">compact compressed textlist</a>)
</p>
+
+[%- PROCESS 'html/foot.tmpl' -%]
[% END %]
[% END %]
+
+[%- PROCESS 'html/foot.tmpl' -%]